나는 전에 파이썬을 사용 해본 적이 없으며 총 n00b이지만 Boto 라이브러리와 Python 3을 사용하여 Windows에서 py로 스크립트를 실행하려고합니다. .주문할 수없는 유형 : NoneType()> str()
latest_date = None
for key in bucket.list(prefix="meta-review/"):
done_file_match = re.match("^meta-review/([^/]+)/done$", key.key)
if done_file_match:
date = done_file_match.group(1)
latest_date = max(date, latest_date)
assert latest_date is not None, "No complete dump folder found!"
하지만 난 출력으로이 오류 메시지가 명령 행 사용하여 스크립트를 실행할 때 : (
INFO:root:Connecting to Amazon S3
INFO:root:Looking for latest complete dump
Traceback (most recent call last):
File "*******.py", line 78, in <module>
download_latest(aws_access_key, aws_secret_key, args.dest_folder)
File "*******.py", line 41, in download_latest
latest_date = max(date, latest_date)
TypeError: unorderable types: NoneType() > str()
을 분명히 별표 개인 정보 보호위한 이 오류를 생성하는 스크립트의 일부입니다). 해결책을 어디서 찾을 수 있습니까? 비슷한 오류가 이미보고되었지만 변경해야 할 사항을 이해하지 못한다고 언급했습니다.
아이디어가 있으십니까? 다른 사람이 언급 한 바와 같이 max
가 작동하지 않을 수
'None '과'str'을 비교할 수 없습니다. 'max()'는 비교를 수행합니다. 그게 다야. – glglgl
사실, 파일 이름에 대해 비공개가 될 수있는 것은 무엇입니까? – glglgl
이것은'assert'의 오용입니다 –