Commit 6a433f5
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>
1 parent 6eb2878 commit 6a433f5
File tree
2 files changed
+16
-0
lines changed- Misc/NEWS.d/next/Windows
- Modules
2 files changed
+16
-0
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1571 | 1571 | | |
1572 | 1572 | | |
1573 | 1573 | | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
1574 | 1587 | | |
1575 | 1588 | | |
1576 | 1589 | | |
| |||
1580 | 1593 | | |
1581 | 1594 | | |
1582 | 1595 | | |
| 1596 | + | |
1583 | 1597 | | |
1584 | 1598 | | |
1585 | 1599 | | |
| |||
0 commit comments