[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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

[3.8] bpo-36779: time.tzname returns empty string on Windows if default cod… (GH-13073) #14032

Merged
merged 1 commit into from Jun 13, 2019

Conversation

Copy link
Contributor

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 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

@zooba

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

Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
Copy link
Contributor Author

miss-islington commented Jun 12, 2019

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

2 similar comments
Copy link
Contributor Author

miss-islington commented Jun 12, 2019

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

Copy link
Contributor Author

miss-islington commented Jun 12, 2019

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

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

None yet

5 participants