diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-12-29 18:02:28 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-12-29 18:02:28 (GMT) |
commit | 1efc23cc35e0224de9831362f0a6c6bc1e606948 (patch) | |
tree | 179b49862b68a491dd5dae9ab3bab62b588db426 /Modules/_fileio.c | |
parent | 0b76601b6e63dfc7a9f29c8a5b53864081781766 (diff) | |
download | cpython-1efc23cc35e0224de9831362f0a6c6bc1e606948.zip cpython-1efc23cc35e0224de9831362f0a6c6bc1e606948.tar.gz cpython-1efc23cc35e0224de9831362f0a6c6bc1e606948.tar.bz2 |
Merged revisions 68016 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68016 | benjamin.peterson | 2008-12-29 11:56:58 -0600 (Mon, 29 Dec 2008) | 1 line
#4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms
........
Diffstat (limited to 'Modules/_fileio.c')
-rw-r--r-- | Modules/_fileio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_fileio.c b/Modules/_fileio.c index b892993..c36a5de 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -116,7 +116,7 @@ fileio_new(PyTypeObject *type, PyObject *args, PyObject *kews) directories, so we need a check. */ static int -dircheck(PyFileIOObject* self) +dircheck(PyFileIOObject* self, char *name) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; @@ -128,8 +128,8 @@ dircheck(PyFileIOObject* self) if (internal_close(self)) return -1; - exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + exc = PyObject_CallFunction(PyExc_IOError, "(iss)", + EISDIR, msg, name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return -1; @@ -290,7 +290,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) #endif goto error; } - if(dircheck(self) < 0) + if(dircheck(self, name) < 0) goto error; } |