diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-12-29 17:47:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-12-29 17:47:42 (GMT) |
commit | fe231b07e41e8cfba8fb79e8440580c37e85183e (patch) | |
tree | f853a3113cab0f98737ca323007d75cce9bda8d6 /Objects | |
parent | 732479f50b46d4df153e178f844ad876e7f63bd8 (diff) | |
download | cpython-fe231b07e41e8cfba8fb79e8440580c37e85183e.zip cpython-fe231b07e41e8cfba8fb79e8440580c37e85183e.tar.gz cpython-fe231b07e41e8cfba8fb79e8440580c37e85183e.tar.bz2 |
#4764 set IOError.filename when trying to open a directory on POSIX platforms
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/fileobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index b2051d7..e01f38e 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -132,8 +132,8 @@ dircheck(PyFileObject* f) if (fstat(fileno(f->f_fp), &buf) == 0 && S_ISDIR(buf.st_mode)) { char *msg = strerror(EISDIR); - PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", - EISDIR, msg); + PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(isO)", + EISDIR, msg, f->f_name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return NULL; |