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

I wasn't aware that CPython builds for MSYS2 out of the box, since it's a 
POSIX-on-Windows platform like Cygwin. Apparently there are patches that enable 
it to build, since MSYS2 has Python available.

For Windows, WCSTOK expands to wcstok_s, which takes a context pointer that 
allows concurrently parsing multiple strings in a single thread. The old 
function lacks this parameter and instead uses a per-thread static buffer. 
They're declared as follows:

    wchar_t *wcstok(wchar_t *strToken, const wchar_t *strDelimit);
    wchar_t *wcstok_s(wchar_t *str, const wchar_t *delimiters,
                      wchar_t **context);

Otherwise the WCSTOK macro expands to wcstok, which assumes that POSIX systems 
use the standard definition [1]:

    wchar_t *wcstok(wchar_t *restrict ws1, const wchar_t *restrict ws2,
                    wchar_t **restrict ptr);

Apparently the version of wcstok declared in your build environment takes only 
two arguments, like the old insecure function in Windows: 

    wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,
                            const wchar_t * __restrict__ _Delim)
    __MINGW_ATTRIB_DEPRECATED_SEC_WARN;

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/wcstok.html

----------
nosy: +eryksun

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

Reply via email to