question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Special characters not supported in the authors section of pyproject.toml

See original GitHub issue

Issue

Poetry does not support special characters in the “authors” section of the pyproject.toml file. I created a new folder, did poetry init and answered no to most of the yes/no questions.

Afterwards, when doing poetry add, it fails:

C:\Users\Stephan\Source\jupyter-lab>poetry add jupyterlab -vvv

[UnicodeDecodeError]
'utf-8' codec can't decode byte 0xe9 in position 88: invalid continuation byte

Exception trace:
 C:\Users\Stephan\.poetry\lib\poetry\_vendor\py3.7\cleo\application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 C:\Users\Stephan\.poetry\lib\poetry\console\application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 C:\Users\Stephan\.poetry\lib\poetry\_vendor\py3.7\cleo\application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 C:\Users\Stephan\.poetry\lib\poetry\console\commands\command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 C:\Users\Stephan\.poetry\lib\poetry\_vendor\py3.7\cleo\commands\base_command.py in run() at line 136
   self.initialize(input_, output_)
 C:\Users\Stephan\.poetry\lib\poetry\console\commands\env_command.py in initialize() at line 18
   current_env = Env.get(self.poetry.file.parent)
 C:\Users\Stephan\.poetry\lib\poetry\console\commands\command.py in poetry() at line 62
   return self.get_application().poetry
 C:\Users\Stephan\.poetry\lib\poetry\console\application.py in poetry() at line 60
   self._poetry = Poetry.create(os.getcwd())
 C:\Users\Stephan\.poetry\lib\poetry\poetry.py in create() at line 98
   local_config = TomlFile(poetry_file.as_posix()).read()
 C:\Users\Stephan\.poetry\lib\poetry\_vendor\py3.7\tomlkit\toml_file.py in read() at line 20
   return loads(f.read())
 C:\Users\Stephan\AppData\Local\Programs\Python\Python37\lib\codecs.py in decode() at line 322
   (result, consumed) = self._buffer_decode(data, self.errors, final)

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

This is because of the “é” character in my name. After removing the “é”, operations using the pyproject.toml file work as expected.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nuno-andrecommented, Apr 1, 2019

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
0reactions
taljaardscommented, Jul 17, 2019

@vlcinsky Yup, it works! Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

poetry install | SolverProblemError Because my_project ...
The problem with your current pyproject.toml is, that you declare built-in packages as dependencies, like os, pathlib, string and others. This ...
Read more >
Adding extra fields in the pyproject.toml authors/ ...
I would normally turn to a pyproject.toml specification to answer it, but that spec has not yet been assembled from the multiple PEPs...
Read more >
The pyproject.toml config file
Run python3 -m flit.tomlify to convert a flit.ini file to pyproject.toml . ... so packages still supporting Python 2 cannot use new-style metadata...
Read more >
The pyproject.toml file | Documentation
If your pyproject. toml file still references poetry directly as a build backend, you should update it to reference poetry-core instead.
Read more >
Flit Documentation
Run python3 -m flit.tomlify to convert a flit.ini file to pyproject.toml. ... If the metadata is invalid, uploading the package to PyPI may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found