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
Fixed setup.py so that it doesn't throw encoding error. #112
Conversation
Without specifying the encoding of the README file, the open defaults to system config encoding, which doesn't have to be 'utf-8'. Opening the file in UTF-8 mode fixes that. Traceback of the error thrown without the fix: `Traceback (most recent call last): File "setup.py", line 156, in <module> README_rst = fd.read() File "C:\Users\n0272436\Downloads\WinPython-32bit-3.4.3.4\python-3.4.3\lib\encodings\cp1252.py", line 23, return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 17233: character maps to <undefined> `
Current coverage is
|
The previous change was invalid for python 2.X, and was breaking the travis CI builds. This fixes the issue, and makes the code compatible to both 2.X and 3.X. The error in question is referred to, and discussed here: http://stackoverflow.com/questions/25049962/is-encoding-is-an-invalid-keyword-error-inevitable-in-python-2-x
So it appears that the build fails due to this pip error: Perhaps opening the file with UTF-8 encoding fails in 3.0-3.2? Not sure why my code would cause this exact behavior. Either way, the failure of test 566.3 seems to pit all other versions of Python against 3.0-3.2. Would it be worth considering to remove those from build tests entirely? |
Thank you for the patch, i'm the dev running on windows so ill try your About dropping Python 3.2, yes we will do but only when a new PyPy3 will be
|
Ps: moderate my previous reply : we will MAYBE drop Py3.2, when a new PyPy3
|
Travis is failing to build the environment (see #117 ) so I'm going to merge this in. master is currently failing due to this issue anyway. |
Ok thank's for confirming the issue and the culprit. I agree, let's drop Py32. It's way too buggy anyway, even in normal circumstances. |
Thank you @shirish93 for the patch! |
What's interesting is that PyPy3, which is based on Py32, doesn't suffer from this issue. So it's all ok for me. |
Without this change, the installation via python setup.py install is broken in certain Windows system with encoding set to other than 'utf-8'.
Without specifying the encoding of the README file, the open defaults to system config encoding, which doesn't have to be 'utf-8'. Opening the file in UTF-8 mode fixes that.
Traceback of the error thrown without the fix:
Traceback (most recent call last): File "setup.py", line 156, in <module> README_rst = fd.read() File "C:\Users\n0272436\Downloads\WinPython-32bit-3.4.3.4\python-3.4.3\lib\encodings\cp1252.py", line 23, return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 17233: character maps to <undefined>