diff options
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r-- | Modules/_io/textio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 5639ad8..2c799e3 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -924,7 +924,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer, goto error; } else { - PyErr_SetString(PyExc_IOError, + PyErr_SetString(PyExc_OSError, "could not determine default encoding"); } @@ -2205,7 +2205,7 @@ _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence) /* Skip chars_to_skip of the decoded characters. */ if (PyUnicode_GetLength(self->decoded_chars) < cookie.chars_to_skip) { - PyErr_SetString(PyExc_IOError, "can't restore logical file position"); + PyErr_SetString(PyExc_OSError, "can't restore logical file position"); goto fail; } self->decoded_chars_used = cookie.chars_to_skip; @@ -2255,7 +2255,7 @@ _io_TextIOWrapper_tell_impl(textio *self) goto fail; } if (!self->telling) { - PyErr_SetString(PyExc_IOError, + PyErr_SetString(PyExc_OSError, "telling position disabled by next() call"); goto fail; } @@ -2421,7 +2421,7 @@ _io_TextIOWrapper_tell_impl(textio *self) cookie.need_eof = 1; if (chars_decoded < chars_to_skip) { - PyErr_SetString(PyExc_IOError, + PyErr_SetString(PyExc_OSError, "can't reconstruct logical file position"); goto fail; } @@ -2693,7 +2693,7 @@ textiowrapper_iternext(textio *self) line = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_readline, NULL); if (line && !PyUnicode_Check(line)) { - PyErr_Format(PyExc_IOError, + PyErr_Format(PyExc_OSError, "readline() should have returned a str object, " "not '%.200s'", Py_TYPE(line)->tp_name); Py_DECREF(line); |