]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1352711: make zipimport raise a complete IOError
authorGeorg Brandl <georg@python.org>
Sun, 19 Feb 2006 09:39:02 +0000 (09:39 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 19 Feb 2006 09:39:02 +0000 (09:39 +0000)
Modules/zipimport.c

index e89005ace721490d53cae6a3a106735eb334475b..3a902cd72963e6c49512db79e12b42dbd14df041 100644 (file)
@@ -434,8 +434,7 @@ zipimporter_get_data(PyObject *obj, PyObject *args)
 
        toc_entry = PyDict_GetItemString(self->files, path);
        if (toc_entry == NULL) {
-               PyErr_Format(PyExc_IOError, "file not found [%.200s]",
-                            path);
+               PyErr_SetFromErrnoWithFilename(PyExc_IOError, path);
                return NULL;
        }
        return get_data(PyString_AsString(self->archive), toc_entry);