-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tc-copy cannot import name 'imap' #669
Conversation
if tile.content_type: | ||
if tile.content_type.startswith("image/"): | ||
tile.data = response.content | ||
else: | ||
tile.error = response.text | ||
elif response.status_code != 200: | ||
tile.error = "Unable to read content type {0}".format(title.content_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you do this change? Shouldn't just be:
if tile.content_type: | |
if tile.content_type.startswith("image/"): | |
tile.data = response.content | |
else: | |
tile.error = response.text | |
elif response.status_code != 200: | |
tile.error = "Unable to read content type {0}".format(title.content_type) | |
if tile.content_type and tile.content_type.startswith("image/"): | |
tile.data = response.content | |
else: | |
tile.error = response.text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes the response has content but not content type header set so it continues failing, i tested it using openstreetmap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you an example of URL that didn't returns a content-type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just merge the first part, and for this I do an alternative as #673, does it look good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't i it be better coding three commands, Ill make it up
Fixed with #673 |
Fix #220