basak / glacier-cli

Command-line interface to Amazon Glacier
Other
617 stars 55 forks source link

check py version and use file.buffer when python3 #75

Closed cnjr2 closed 4 years ago

cnjr2 commented 4 years ago

attempt at fixing issue #74

basak commented 4 years ago

Thank you for the patch!

I'm not sure about this fix though. I do specify argparse.FileType('rb') so it isn't clear to me why a str is appearing.

If you think this is the correct fix, please could you explain why use of the buffer attribute is appropriate for Python 3 but not for Python 2?

soxofaan commented 4 years ago

I'm not sure about this fix though. I do specify argparse.FileType('rb') so it isn't clear to me why a str is appearing.

see my comment in https://github.com/basak/glacier-cli/issues/74#issuecomment-605530828

It's a know issue apparently since 2012: https://bugs.python.org/issue14156

soxofaan commented 4 years ago

FYI: I created an alternative solution without version sniffing: #77

basak commented 4 years ago

Thanks. I merged #77, but thank you also to @cnjr2 for finding the original workaround.