-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
UnicodeDecodeError in Masonry with MSYS2 #1027
Comments
Save your To handle different encodings, it needs to depend on Reference: https://stackoverflow.com/questions/436220/how-to-determine-the-encoding-of-text |
@drunkwcodes My pyproject.toml, and the rest of my project is in UTF-8. The issue is that Poetry is calling |
Sorry. Here it is. Please try to change msys2's encoding setting to utf-8. https://stackoverflow.com/questions/28481410/how-to-set-console-encoding-in-msys |
@drunkwcodes Thanks for trying to research possible solutions. The correct default/preferred encoding of the contents of files for Windows users is cp1252. This is what is returned when I call locale.getpreferredencoding(). It is not a solution for me to change my default encoding. This issue here is that Poetry is opening pyproject.toml, which should be UTF-8 for all users, without specifying the encoding to use. |
@danyeaw Sorry for not having a solution for you to change your default encoding, sir. What a lovely night. |
I believe #1030 is related to this issue. I don't think it's safe to assume that the locale will always be set to UTF-8 on systems where poetry (or packages using poetry, such as pendulum) might be installed. |
We (me and @rhorenov) had problem to install If the package was to be built (e.g. Installing packages from wheels worked well. I am going to create PR for master to fix this issue (adding explicit encoding where files are open for writing in text mode). |
…try#1027) This is minimal set of modifications, which fixed the problem. There are still more places, where files are open in text mode without explicit encoding, thus possibly failing on systems not using UTF-8 console encoding.
…1088) * Fix encoding for files created for building package (issue #1027) This is minimal set of modifications, which fixed the problem. There are still more places, where files are open in text mode without explicit encoding, thus possibly failing on systems not using UTF-8 console encoding. * test_api.py use explicit encoding for files. * get-poetry.py: fix explicit (utf-8) encoding for files open in text mode * tests: fix explicit (utf-8) encoding for files open in text mode * poetry init: use explicit utf-8 for created pyproject.toml * installed: use explicit utf-8 for text files * layouts: use explicit utf-8 for open text files * spdx: explicit utf-8 for open text files * pypi_repository: explicit utf-8 for open text files * explicit utf-8 for json * explicit utf-8 for metadata * explicit utf-8 for requires.txt * open files with explicit encoding in py27 * fix creation of poetry.bat on Windows * Make get-poetry.py compatible to py2/3 * Blacked two files to pass linter test * remove extranous encoding related comments * rewert broken move of import related to ansible * removed extraneous comments about opening files in UTF-8 * rewert ansible.release import (keep order of vars unchanged) * Revert to original content (as it comes from external project) * all vendored setup.py files in fixtures reverted back to org
Can @danyeaw or anyone else check, that the latest poetry version 0.12.17 is not not suffering this problem? |
Closed by commit e9a13f8 👍 |
Greate @danyeaw Can you close the issue? I do not seem to have such option. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Windows 10 with MSYS2 20180531
Poetry version: 0.12.11
Link of a Gist with the contents of your pyproject.toml file: https://github.com/gaphor/gaphor/blob/master/pyproject.toml
Issue
When trying to pip install my app I am getting a UnicodeDecodeError.
It looks like Poetry is not using an encoding when it calls open() to load the description.
I am opening the issue here after exploring the cause in MSYS2 first: msys2/MINGW-packages#5155
The text was updated successfully, but these errors were encountered: