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

Projects
None yet
2 participants
@maxkrivich
Contributor

maxkrivich commented Jun 28, 2018

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)

maxkrivich and others added some commits Jun 28, 2018

@techalchemy

This comment has been minimized.

Member

techalchemy commented Jun 28, 2018

Thanks for the pr (again)

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

@maxkrivich

This comment has been minimized.

Contributor

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

This comment has been minimized.

Member

techalchemy commented Jun 28, 2018

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

@techalchemy

This comment has been minimized.

Member

techalchemy commented Jun 28, 2018

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

0 of 2 checks passed

buildkite/pipenv Build #631 started
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment