pypa/virtualenv

Not compatible with a directory having emojis in its path

yadavankit opened this issue · 11 comments

Am getting this Traceback when running virtualenv venv to create a virtualenv in a directory having emojis etc in its path -
New python executable in /Users/WARL0CK/✮✮Python✮✮/evalai/venv/bin/python2.7 Also creating executable in /Users/WARL0CK/✮✮Python✮✮/evalai/venv/bin/python Traceback (most recent call last): File "<string>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 15: ordinal not in range(128) ERROR: The executable /Users/WARL0CK/✮✮Python✮✮/evalai/venv/bin/python2.7 is not functioning ERROR: It thinks sys.prefix is u'/Users/WARL0CK/\u272e\u272ePython\u272e\u272e/evalai' (should be u'/Users/WARL0CK/\u272e\u272ePython\u272e\u272e/evalai/venv') ERROR: virtualenv is not compatible with this system or executable

Extra Info : Am running this on MacOS Sierra

I guess my patch at #900 can fix this

... which as noted in that PR, is stalled on being refactored out into separate PRs.

I'm not completely convinced that #900 is related, but it might be worth a try. Although honestly, I'd be more inclined to suggest renaming the directory to not include emojis in the name - Python 2's Unicode support isn't something I'd like to trust with that type of stress... 😉

Any hope of fixing this?

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

Still no good.

JDLH commented

According to a comment on #53 (comment), it appears this bug is fixed by pip 10.0.0, released 2018-04-14. @melikyuksel , did you test this issue using pip 10.0.0?

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

This is not just about emojis, also about internationalization support. Gnome by default creates directories with Swedish names on a Swedish locale. So for example the Downloads dir is called Hämtningar.

I just encountered this issue trying to create a virtualenv in the directory Hämtningar.

There is a proposed PR further up in comments, I haven't looked at it but you'd think that by 2019 Python should be able to handle this.

The workaround is of course simple, just avoid using the directory for now.

Will address this part of #697

Duplicate of #457