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

Fix UnicodeEncodeError in help.py #2466

Merged
merged 3 commits into from
Jun 29, 2018

Conversation

maxkrivich
Copy link
Contributor

I don't know why but on MacOS when you execute this command python -m pipenv.help and redirect output stream to some another file, script fails with exception.

$ python -m pipenv.help > test.txt 
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/maxkrivich/Projects/pipenv/pipenv/help.py", line 89, in <module>
    main()
  File "/Users/maxkrivich/Projects/pipenv/pipenv/help.py", line 48, in main
    print(u'Pipenv–specific environment variables:')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 6: ordinal not in range(128)

@techalchemy
Copy link
Member

Thanks for the pr (again)

I wonder if this works on windows... will test when I get home

@maxkrivich
Copy link
Contributor Author

maxkrivich commented Jun 28, 2018

@techalchemy I'm not sure what it is reproducible on windows. That module really very powerful and I just wanna to improve them.

@techalchemy
Copy link
Member

Yeah just want to make sure that the explicit encoding doesn't break anything in the console, checking now

@techalchemy
Copy link
Member

works ok for me, thanks for the fix!

@techalchemy techalchemy added this to the 2018.7.0 milestone Jun 28, 2018
@techalchemy techalchemy merged commit 9d826c4 into pypa:master Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants