Message389645
I closed bpo-20010 because the official PSF distributions of Python 3.5+ for Windows use the Universal CRT (ucrt), the system C runtime library for applications. ucrt does not have this problem with the "%z" format code. For example, using ctypes:
>>> import ctypes
>>> timeptr = (ctypes.c_int * 9)()
>>> dest = (ctypes.c_char * 100)()
>>> ucrt = ctypes.CDLL('ucrtbase', use_errno=True)
>>> ucrt.strftime(dest, 100, b"%z", timeptr)
5
>>> dest.value
b'+0100'
Mingw-w64 probably links against msvcrt.dll, the private CRT that's used by some system components. For example:
>>> msvcrt = ctypes.CDLL('msvcrt', use_errno=True)
>>> msvcrt.strftime(dest, 100, b"%z", timeptr)
22
>>> dest.value
b'Mitteleurop\xe4ische Zeit'
This a third-party problem since Python is simply calling C strftime(). I'll leave this open for a core developer to consider, but I don't think a workaround is likely at this level. IIRC, compiling Python with Mingw-w64 requires extensive patching, so a workaround is more likely to be applied at that level. |
|
Date |
User |
Action |
Args |
2021-03-28 19:24:26 | eryksun | set | recipients:
+ eryksun, paul.moore, vstinner, tim.golden, ezio.melotti, r.david.murray, Aaron.Meurer, docs@python, zach.ware, steve.dower, civalin, kepkin, martin-t, Václav Dvořák, ede123 |
2021-03-28 19:24:26 | eryksun | set | messageid: <1616959466.42.0.551141230107.issue43649@roundup.psfhosted.org> |
2021-03-28 19:24:26 | eryksun | link | issue43649 messages |
2021-03-28 19:24:26 | eryksun | create | |
|