Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b98cda4

Browse files
committed
Patch #1314 by Christian Heimes.
Fix failing unittests for time and strptime on German and probably other localized Windows installations.
1 parent e1a0d11 commit b98cda4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Modules/timemodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ time_strftime(PyObject *self, PyObject *args)
528528
e.g. an empty format, or %Z when the timezone
529529
is unknown. */
530530
PyObject *ret;
531-
ret = PyUnicode_FromStringAndSize(outbuf, buflen);
531+
ret = PyUnicode_Decode(outbuf, buflen,
532+
TZNAME_ENCODING, NULL);
532533
PyMem_Free(outbuf);
533534
return ret;
534535
}
@@ -1035,5 +1036,3 @@ floatsleep(double secs)
10351036

10361037
return 0;
10371038
}
1038-
1039-

0 commit comments

Comments
 (0)