Eryk Sun added the comment:

Parsing the argument is also broken:

    static PyObject *
    msvcrt_ungetwch(PyObject *self, PyObject *args)
    {
        Py_UNICODE ch;

        if (!PyArg_ParseTuple(args, "u:ungetwch", &ch))
            return NULL;

        if (_ungetch(ch) == EOF)
            return PyErr_SetFromErrno(PyExc_IOError);
        Py_INCREF(Py_None);
        return Py_None;
    }

Format "u" is a `Py_UNICODE *`. There's no "C" format code in 2.x, so it will 
first have to check that the string length is exactly 1 and then use index 0.

----------
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> needs patch

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

Reply via email to