[Python-3000-checkins] r58733 - python/branches/py3k/Modules/_fileio.c
christian.heimes
python-3000-checkins at python.org
Wed Oct 31 20:20:49 CET 2007
Author: christian.heimes
Date: Wed Oct 31 20:20:48 2007
New Revision: 58733
Modified:
python/branches/py3k/Modules/_fileio.c
Log:
Fixed bug in _fileio.c and test_pep277. On Windows IOError.filename was not set because the name is stored in widename.
Modified: python/branches/py3k/Modules/_fileio.c
==============================================================================
--- python/branches/py3k/Modules/_fileio.c (original)
+++ python/branches/py3k/Modules/_fileio.c Wed Oct 31 20:20:48 2007
@@ -267,7 +267,11 @@
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;
}
}
More information about the Python-3000-checkins
mailing list