[docs] [issue12434] Strengthen 2.7 io types warning

Eli Bendersky report at bugs.python.org
Sat Jul 16 11:04:03 CEST 2011

Eli Bendersky <eliben at gmail.com> added the comment:

The difference between 2.6 and 2.7 stems from the rewrite of the IO library in C that was made for 2.7

The error Terry sees gets thrown here (in Modules/_io/stringio.c):

    if (!PyUnicode_Check(obj)) {
        PyErr_Format(PyExc_TypeError, "string argument expected, got '%s'",
        return NULL;

Therefore, I propose to change this error message to:

"unicode argument expected, got '%s'"

as Terry suggested.

Adding Antoine, Benjamin and Daniel (listed as experts on IO) to nosy.

Is there an objection to making this change in the error message?

nosy: +benjamin.peterson, pitrou, stutzbach

Python tracker <report at bugs.python.org>

More information about the docs mailing list