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
calendar.LocaleHTMLCalendar.formatyearpage() results in traceback with 'unsupported locale setting' on Windows #54707
Comments
See bpo-10466 for background, but in short LocaleHTMLCalendar uses getdefaultlocale if no locale is specified, and on windows this results in a locale that setlocale will not accept. The fix is presumably to use setlocale(LC_DATE, '') instead of getdefaultelocale. |
See also bpo-10087. |
Fails on OS X as well for similar reasons. |
On OSX, _locale.setlocale raise locale.Error with arg 'UTF8' but ok with 'UTF-8'. and setlocale tries to normalize localename with locale.normalize(). and locale.normalize() always change encoding to 'UTF8' (locale.py:646). So changes in locale.normalize could fix this issue at least on OSX. patch and unittest against p3k is attached. I did not search why normalize() changes 'utf_8' to 'UTF8' until now. but I would post if I get answer in subversion log. |
r38027 has following changes.
subversion log is: Correct mapping of Python codec name to C encoding name for UTF-8 (the C lib doesn't seem to like "UTF-8"). |
I'm closing this in favor of bpo-21731, which has a proposed (though I believe incorrect) patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: