From: Christian Heimes Date: Wed, 31 Oct 2007 19:20:48 +0000 (+0000) Subject: Fixed bug in _fileio.c and test_pep277. On Windows IOError.filename was not set becau... X-Git-Tag: v3.0a2~247 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b48954cd856e0391acefb6355a4ab98e5f7b3c0;p=thirdparty%2FPython%2Fcpython.git Fixed bug in _fileio.c and test_pep277. On Windows IOError.filename was not set because the name is stored in widename. --- diff --git a/Modules/_fileio.c b/Modules/_fileio.c index 8469bb248f27..f02c5ef16a2f 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -267,7 +267,11 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) self->fd = open(name, flags, 0666); Py_END_ALLOW_THREADS if (self->fd < 0 || dircheck(self) < 0) { +#ifdef MS_WINDOWS + PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); +#else PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); +#endif goto error; } }