Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jun 12, 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 [email protected]

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

@zooba

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

Co-authored-by: Paul Monson <[email protected]>
@miss-islington
Copy link
Contributor Author

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

2 similar comments
@miss-islington
Copy link
Contributor Author

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

@miss-islington
Copy link
Contributor Author

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

@vstinner vstinner merged commit 0a9baec into python:3.8 Jun 13, 2019
@miss-islington miss-islington deleted the backport-b4c7def-3.8 branch June 13, 2019 13:22
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.

5 participants