Skip to content

Fix "Exception when locale is undefined or C" (Debian bug #852813)#2

Open
homeworkprod wants to merge 1 commit intokcoyner:masterfrom
homeworkprod-forks:locale-fallback-fix
Open

Fix "Exception when locale is undefined or C" (Debian bug #852813)#2
homeworkprod wants to merge 1 commit intokcoyner:masterfrom
homeworkprod-forks:locale-fallback-fix

Conversation

@homeworkprod
Copy link

If LANG=C is set on Python 3, the encoding would be None. See Debian bug #852813 for details.

To at least get rid of the exception and traceback, I have attached a patch that prints an error message and exits.

A more elaborate fix might be to provide a fallback encoding (maybe ASCII?). Then again, I'm not sure why the encoding is dependent of the locale at all.
Maybe it should be a robust default (UTF-8?) that can optionally be overridden?

If `LANG=C` is set on Python 3, the encoding would be `None`.
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.

1 participant