Eryk Sun <eryk...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to