Skip to content
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

"'ascii' codec can't encode characters " from poetry init #1675

Closed
3 tasks done
Uninen opened this issue Dec 5, 2019 · 3 comments
Closed
3 tasks done

"'ascii' codec can't encode characters " from poetry init #1675

Uninen opened this issue Dec 5, 2019 · 3 comments
Labels
kind/bug Something isn't working as expected

Comments

@Uninen
Copy link

Uninen commented Dec 5, 2019

  • 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: macOS Mojave ( 10.14.6 )

  • Poetry version: 1.0.0b8

  • Python version: 2.7.16

Issue

When I run poetry init in a directory that has a fresh git repository, the script asks for package name (suggested "misc-python-scripts"), version and description. Left everything as defaults, and when moving forward, the script will pit out an endless loop of 'ascii' codec can't encode characters in position 24-25: ordinal not in range(128). This is possibly related to #221.

Screenshot 2019-12-05 at 10 57 25

I suspect Poetry might try to use my name from git config or somewhere else (in git config: user.name=Ville Säävuori) and it just fails to handle this as unicode. On my version of macOS, default Python version is 2.7.16.

@Uninen Uninen added the kind/bug Something isn't working as expected label Dec 5, 2019
@Uninen
Copy link
Author

Uninen commented Dec 5, 2019

After reading the comments from #221 I tried to run poetry init --author="Ville Säävuori" -vvv and poetry init --author="Ville Saavuori" -vvv of which the first one fails:

 ✘ uninen@somiya  ~/Local/Code/LVS/misc-python-scripts   master  poetry init --author="Ville Säävuori" -vvv

This command will guide you through creating your pyproject.toml config.

Package name [misc-python-scripts]:
Version [0.1.0]:
Description []:

[UnicodeDecodeError]
'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)

Traceback (most recent call last):
Traceback (most recent call last):
  File "/Users/uninen/.poetry/bin/poetry", line 14, in <module>
    main()
  File "/Users/uninen/.poetry/lib/poetry/console/__init__.py", line 5, in main
    return Application().run()
  File "/Users/uninen/.poetry/lib/poetry/_vendor/py2.7/clikit/console_application.py", line 139, in run
    trace.render(io, simple=isinstance(e, CliKitException))
  File "/Users/uninen/.poetry/lib/poetry/_vendor/py2.7/clikit/ui/components/exception_trace.py", line 57, in render
    self._render_traceback(io, tb)
  File "/Users/uninen/.poetry/lib/poetry/_vendor/py2.7/clikit/ui/components/exception_trace.py", line 67, in _render_traceback
    io.write_line("".join(traceback.format_list(frames)))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 39, in format_list
    item = '  File "%s", line %d, in %s\n' % (filename,lineno,name)
TypeError: %d format: a number is required, not str

but the latter goes through and initializes the project correctly. Still don't know if this is the same problem than #221 but feel free to close this if it's the same bug.

@finswimmer
Copy link
Member

Hello @Uninen ,

this looks to me like #221. So I will close this.

Thanks a lot for reporting!

fin swimmer

Copy link

github-actions bot commented Mar 3, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants