]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1314 by Christian Heimes.
authorGuido van Rossum <guido@python.org>
Tue, 23 Oct 2007 19:43:28 +0000 (19:43 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 23 Oct 2007 19:43:28 +0000 (19:43 +0000)
Fix failing unittests for time and strptime on German and probably other
localized Windows installations.

Modules/timemodule.c

index cd50594f2b128bfb3750fb2e9305abc89cc1d5f6..d7e5cfd9d814fd935508e2501a488f509cde61ba 100644 (file)
@@ -528,7 +528,8 @@ time_strftime(PyObject *self, PyObject *args)
                           e.g. an empty format, or %Z when the timezone
                           is unknown. */
                        PyObject *ret;
-                       ret = PyUnicode_FromStringAndSize(outbuf, buflen);
+                       ret = PyUnicode_Decode(outbuf, buflen,
+                                              TZNAME_ENCODING, NULL);
                        PyMem_Free(outbuf);
                        return ret;
                }
@@ -1035,5 +1036,3 @@ floatsleep(double secs)
 
        return 0;
 }
-
-