-
Notifications
You must be signed in to change notification settings - Fork 7
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
FileType requires the encoding argument to be specified #6
Comments
Hi @haadr, thanks for the report! Curious, did you happen to try the advice in the Gotchas section of the README? If so, did that assist if your case at all? |
Hi and thanks for the response! I feel embarrassed that I didn't notice that section of the readme, however it doesn't seem to help. For what it's worth, personally, I don't have a problem simply running it with python3 and specifying the encoding manually/in-code. However I also don't quite understand the python2-related encoding problem either. Setting PYTHONIOENCODING doesn't seem to help (see below). I can't pretend to have much experience when it comes to UTF-8 and python2/3 compatability, but people seem to recommend importing io to get the encoding argument for the open() function. Another solution that makes the error go away for me is not trying to decode it from UTF-8 when passing it to the file object for writing (I guess it will then just pass what it got from requests? A quick search didn't tell me whether requests defaults to utf8 in this case...)
Original error with the environment variable:
|
Thanks for the additional info. I'll try to test a few edge cases. I'll report status below when I get to it. |
Hi there and thanks for a great script!
I ran into this today, which was solved by passing
encoding="UTF-8"
to the FileType constructor used by the metavar FILE (-o file option) and forcing the script to run in python3.The text was updated successfully, but these errors were encountered: