-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
pipenv doesn't work with locale encoding different than UTF-8 on Linux #3131
Comments
Emojis are not the only cause. Pseudographics used in a progress bar will cause the same kind of errors. |
If you want French locale (or any other locale) in 2018 you should be using UTF aware locale like |
This is unfortunate but you have to talk to Kenneth about it :( We really ought to just ignore them if they can’t be printed, but click also demands utf8 locale settings. In the interim you can set I have to admit I’m curious to see what exactly you’re working on :) |
Well, it's just an example of locale. There are other locales which don't use UTF-8, but ASCII, ShiftJIS or anything else.
Oh. |
@vstinner I did just rewrite some of our output encoding to use translation maps and native encodings, so I’m wondering how I can solve this most helpfully. You certainly would know more on the subject so if you have any insight I’d be curious. Currently we basically use To write output we essentially use this approach:
I’m wondering if I shouldn’t just use an ignore errors re-encoding approach there |
If the locale is C, it will be coerced to C.utf-8 by Python. If the locale is not C and not utf-8 based, something is wrong (at least on Linux) and maybe the user just needs to be told (i.e. do what click does: abort). |
@techalchemy looking at your code for fail-safe decoding/encoding of text it reminds me of one converter that I made in the past, which uses python's codecs.register_error. You can look at my convert-encoding.py The only downside with this approach is that you are registering this converter globally and if this technique is used by different modules then there is a chance of name collision if names are not carefully chosen. |
- Drops any unmapped non-ascii characters on non-utf8 systems - Fixes #3131 Signed-off-by: Dan Ryan <[email protected]>
Thank you ;-) |
Hi,
I wanted to try pipenv, but it doesn't work with the fr_FR locale.
Versions:
It seems like pipenv likes non-ASCII characters for fancy output.
The text was updated successfully, but these errors were encountered: