Closed taljaards closed 5 years ago
Are you writing the pyproject.toml in UTF-8? Are you using a UTF-8 character for the é?
I had this issue too when using init
since it uses the output of git config --list
to populate the default authors
section but the é
in Git was not properly encoded. Resetting it with git config
solved the issue for me.
Another é-named here.
I think the problem (also for #221) is that subprocess
calls git
pipelining through Windows stdio, which hasn't native support for UTF-8, the MinGW default encoding. Hence the replacement character
.
From Python 3.7 (PEP 540) this can be circumvented by setting the environment variable PYTHONUTF8 which makes Python to ignore local encoding using UTF-8.
So, this annoyance for us the beyondasciians (sorry) can be avoided in cmd with:
set PYTHONUTF8=1 && poetry init
Or for posh:
$env:PYTHONUTF8=1; poetry init
I would say, the problem is related to writing pyproject.toml
file without explicit utf-8
encoding thus using default, what is likely to fail on some Windows.
https://github.com/sdispater/poetry/blob/master/poetry/console/commands/init.py#L161
Fixed in PR #1085 or in it's extended version (fixing more places dealing with properly stating encoding to use) PR #1087
@taljaards can you check, if the latest poetry 0.12.17 works well?
@vlcinsky Yup, it works! Thanks.
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.
[x] I am on the latest Poetry version.
[x] I have searched the issues of this repo and believe that this is not a duplicate.
[x] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Windows 10 17763.253
Poetry version: 0.12.11
pyproject.toml file: https://gist.github.com/taljaards/b06c1dda1ece0b8d443eb9512213e47d
Issue
Poetry does not support special characters in the "authors" section of the
pyproject.toml
file. I created a new folder, didpoetry init
and answered no to most of the yes/no questions.Afterwards, when doing
poetry add
, it fails:This is because of the "é" character in my name. After removing the "é", operations using the
pyproject.toml
file work as expected.