Menu

#756 PyWin_NewUnicode doesn't work correctly on new Python versions

v1.0 (example)
open
nobody
None
5
2017-08-15
2017-08-15
Xaav
No

Source:

// @pymethod <o PyUnicode>|win32types|Unicode|Creates a new Unicode object
PYWINTYPES_EXPORT PyObject *PyWin_NewUnicode(PyObject *self, PyObject *args)
{
    char *string;
    int slen;
    if (!PyArg_ParseTuple(args, "t#", &string, &slen))
        return NULL;
    return PyUnicode_DecodeMBCS(string, slen, NULL);
}

The "t#" format string is not valid on Python 3.

Discussion