Jesús Cea Avión added the comment:
I think this patch must be applied too to 2.7 and 3.2.
Felipe, you are using %R modifier, but that modifier doesn't exist in
Solaris, for instance. This seems to be a Linux specific option, I don't know
what it does.
Also, you should be sure not to overflow
Antoine Pitrou added the comment:
Jesus, please read the PyErr_Format() documentation.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15897
___
Felipe Cruz added the comment:
Should I send patches for 3.2 and 2.7?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15897
___
___
Jesús Cea Avión added the comment:
Antoine, I was reading the documentation of Python 2.7. It doesn't support %R.
Felipe, Python 2.7 has direct access to the path. You can print it directly, in
this case. I will take care of this.
--
assignee: - jcea
Roundup Robot added the comment:
New changeset 39e608d462b6 by Jesus Cea in branch '2.7':
Closes #15897: zipimport.c doesn't check return value of fseek()
http://hg.python.org/cpython/rev/39e608d462b6
New changeset 4da48083aaab by Jesus Cea in branch '3.2':
Closes #15897: zipimport.c doesn't
Christian Heimes added the comment:
You broke the build of 3.2:
./Modules/zipimport.c: In function 'read_directory':
./Modules/zipimport.c:747:65: error: 'archive' undeclared (first use in this
function)
./Modules/zipimport.c:747:65: note: each undeclared identifier is reported only
once for
Roundup Robot added the comment:
New changeset 0f4d4f4db724 by Jesus Cea in branch '3.2':
Closes #15897: zipimport.c doesn't check return value of fseek(). Typo
http://hg.python.org/cpython/rev/0f4d4f4db724
--
resolution: - fixed
status: open - closed
Felipe Cruz added the comment:
Hello!
Just sent the Contributor Agreement Form.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15897
___
___
Jesús Cea Avión added the comment:
Felipe, could you please submit a Contributor Agreement Form?
http://www.python.org/psf/contrib/
Your patch looks good to me, although I would move almost all
fclose(fp);
PyErr_Format(ZipImportError, can't read Zip file: %R, archive);
return NULL;
To a
Felipe Cruz added the comment:
I've updated the patch changing fseek_error goto block error return from
PyErr_SetFromErrno to PyErr_Format(ZipImportError, can't read Zip file: %R,
archive); (returning NULL after).
--
Added file: http://bugs.python.org/file27194/issue15897_v1.patch
Christian Heimes added the comment:
You can further compress the changes when you get rid of `rc` and check the
return value inline, for example:
if (fseek(...) == -1) {
errorhandler;
}
--
___
Python tracker rep...@bugs.python.org
Felipe Cruz added the comment:
v4 - inline fseek return code check - as Christian suggested
--
Added file: http://bugs.python.org/file27195/issue15897_v4.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15897
Felipe Cruz added the comment:
Hello!
This is one of my first patches.
Tests still OK! Let me know what you think!
Thanks!
--
keywords: +patch
nosy: +felipecruz
Added file: http://bugs.python.org/file27191/issue15897_v1.patch
___
Python tracker
Felipe Cruz added the comment:
Patch updated - fseek errors messges will be can't read Zip file' and not
can't Open Zip file
--
Added file: http://bugs.python.org/file27192/issue15897_v1.patch
___
Python tracker rep...@bugs.python.org
Ezio Melotti added the comment:
I suggested to Felipe on IRC to use read instead of seek because I don't
think it's worth making a distinction between the two. Moreover ISTM that in
most of the cases, if the fseek fails, the error is detected in a following
fread, so the message currently
New submission from Christian Heimes:
The code im zipimport.c doesn't check the return value of fseek() in at least
four places. The missing checks may hide issues with the file or file system.
Solution:
Check for -1 and return with an appropriate call to PyErr_SetFromErrno()
--
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15897
___
___
Python-bugs-list mailing list
17 matches
Mail list logo