Merged revisions 68134 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68134 | hirokazu.yamamoto | 2009-01-02 00:45:39 +0900 | 2 lines

  Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open
  file with `str' filename on Windows.
........
This commit is contained in:
Hirokazu Yamamoto 2009-01-01 16:03:45 +00:00
parent 646d9a20b9
commit 0f22d69cf6
2 changed files with 7 additions and 3 deletions

View file

@ -12,6 +12,9 @@ What's New in Python 3.1 alpha 0
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open
file with `str' filename on Windows.
- Issue #3680: Reference cycles created through a dict, set or deque iterator - Issue #3680: Reference cycles created through a dict, set or deque iterator
did not get collected. did not get collected.

View file

@ -284,10 +284,11 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
if (self->fd < 0) { if (self->fd < 0) {
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename); if (widename != NULL)
#else PyErr_SetFromErrnoWithUnicodeFilename(PyExc_IOError, widename);
PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); else
#endif #endif
PyErr_SetFromErrnoWithFilename(PyExc_IOError, name);
goto error; goto error;
} }
if(dircheck(self, name) < 0) if(dircheck(self, name) < 0)