Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commented Jun 13, 2019

Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].

This causes time.tzname to be an empty string.
I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.

In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7

@zooba

https://bugs.python.org/issue36779
(cherry picked from commit b4c7def)

Co-authored-by: Paul Monson paulmon@users.noreply.github.com

https://bugs.python.org/issue36779

pythonGH-13073) Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[]. This causes time.tzname to be an empty string. I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production. In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7 @zoobahttps://bugs.python.org/issue36779 (cherry picked from commit b4c7def) Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good bot.

@miss-islington
Copy link
ContributorAuthor

@paulmon: Status check is done, and it's a success ✅ .

@miss-islingtonmiss-islington merged commit 6a433f5 into python:3.7Jun 13, 2019
@miss-islingtonmiss-islington deleted the backport-b4c7def-3.7 branch June 13, 2019 13:42
@miss-islington
Copy link
ContributorAuthor

@paulmon: Status check is done, and it's a success ✅ .

Sign up for freeto 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.

5 participants

@miss-islington@vstinner@the-knights-who-say-ni@bedevere-bot@paulmon