diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-06 17:07:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-06 17:07:17 (GMT) |
commit | d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6 (patch) | |
tree | a1966e33692ba9de3966c9760957233f51142cb2 /Modules/_io/fileio.c | |
parent | 4a4b67951570a8a0452c77a5ebaa98b9ef9fb712 (diff) | |
download | cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.zip cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.tar.gz cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.tar.bz2 |
Issue #22215: Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
Diffstat (limited to 'Modules/_io/fileio.c')
-rw-r--r-- | Modules/_io/fileio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 280523b..84d2ff3 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -256,7 +256,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) int rv = _PyUnicode_HasNULChars(nameobj); if (rv) { if (rv != -1) - PyErr_SetString(PyExc_TypeError, "embedded NUL character"); + PyErr_SetString(PyExc_ValueError, "embedded null character"); return -1; } widename = PyUnicode_AsUnicode(nameobj); |