diff options
author | Jesus Cea <jcea@jcea.es> | 2012-10-03 01:16:42 (GMT) |
---|---|---|
committer | Jesus Cea <jcea@jcea.es> | 2012-10-03 01:16:42 (GMT) |
commit | cf45325b61e2eb3a2c83b9f869cf56684d6cb679 (patch) | |
tree | 7570f9c9dc74e96837a4dd9ec2ad2890d813b03a /Modules | |
parent | 83451a2b40d1e0eee4889c302d9b50eacd26995e (diff) | |
download | cpython-cf45325b61e2eb3a2c83b9f869cf56684d6cb679.zip cpython-cf45325b61e2eb3a2c83b9f869cf56684d6cb679.tar.gz cpython-cf45325b61e2eb3a2c83b9f869cf56684d6cb679.tar.bz2 |
Closes #15897: zipimport.c doesn't check return value of fseek(). Typo
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/zipimport.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index d4e4927..7ae4f0a 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -744,7 +744,7 @@ read_directory(PyObject *archive_obj) if (fseek(fp, -22, SEEK_END) == -1) { fclose(fp); - PyErr_Format(ZipImportError, "can't read Zip file: %R", archive); + PyErr_Format(ZipImportError, "can't read Zip file: %U", archive_obj); return NULL; } header_position = ftell(fp); @@ -861,7 +861,7 @@ fseek_error: fclose(fp); Py_XDECREF(files); Py_XDECREF(nameobj); - PyErr_Format(ZipImportError, "can't read Zip file: %R", archive); + PyErr_Format(ZipImportError, "can't read Zip file: %U", archive_obj); return NULL; error: fclose(fp); @@ -934,7 +934,7 @@ get_data(PyObject *archive, PyObject *toc_entry) /* Check to make sure the local file header is correct */ if (fseek(fp, file_offset, 0) == -1) { fclose(fp); - PyErr_Format(ZipImportError, "can't read Zip file: %R", archive); + PyErr_Format(ZipImportError, "can't read Zip file: %U", archive); return NULL; } @@ -949,7 +949,7 @@ get_data(PyObject *archive, PyObject *toc_entry) } if (fseek(fp, file_offset + 26, 0) == -1) { fclose(fp); - PyErr_Format(ZipImportError, "can't read Zip file: %R", archive); + PyErr_Format(ZipImportError, "can't read Zip file: %U", archive); return NULL; } @@ -973,7 +973,7 @@ get_data(PyObject *archive, PyObject *toc_entry) bytes_read = fread(buf, 1, data_size, fp); } else { fclose(fp); - PyErr_Format(ZipImportError, "can't read Zip file: %R", archive); + PyErr_Format(ZipImportError, "can't read Zip file: %U", archive); return NULL; } fclose(fp); |