New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZipFile.open - read-only file-like obj for files in archive #41565
Comments
I originally started working on updating patch 992750, This patch provides a new open() method on ZipFile; ZipFile.read was modified to use the new open method The patched zipfile.py passed the existing tests in the I have only run the tests on Windows XP, using If the patch is accepted I'll also generate and submit |
Logged In: YES zipfile_patch2.tgz: I updated the file-like object to Passes regression tests on 2.5a0 built from CVS HEAD with |
Logged In: YES The patch is reversed: usually, diff is invoked as "-c old new". I think it is almost right, but I have a few remarks:
|
Logged In: YES Hmm...I could have sworn I did the diff in the correct Here's my comments on your remarks (in order):
Right now ZipExtFile uses the ZipFile's file object, so you I'm sure that somebody will eventually try to use the |
Logged In: YES Uploaded the third revision of this patch; passes all |
Logged In: YES I found a problem with my universal newline handling code in I'm going to test the open() capability in a real |
Logged In: YES After testing on my large batch of large Zip files, I made |
Logged In: YES Revision 5 of this patch has been in constant use with |
Can you please update the patch to the current subversion trunk? I'd like to apply it, but the code of zipfile has changed so that the patch is currently out-of-date. When redoing it, notice that the read implementation has changed (I couldn't figure out how you moved code around). Please do use the trunk (not Python 2.5), and please submit the patch as a single 'svn diff' output (rather than a tar file containing multiple individual diff files). |
I will see if I can make some progress on this over the weekend. |
Twisted also contains an implementation of this functionality, available from
As far as I can tell it doesn't have anything to recommend it over the attached patch, however (in fact, the test coverage of the attached patch looks better), but perhaps it has some behavior which might be desirable to steal. |
Thanks, glyph; I'll definitely have a look and see what I can steal. :-) |
Here is a version of the patch against the current trunk. It passes a "make test" on my Gentoo laptop at the moment, but I think I still need to add some more tests (like reading from encrypted compressed files), and I need to try out the test_zipfile64 stuff. I don't have time today to look through the module Glyph suggested, so it may be that after I do that I'll have some more tweaks to make. I'm pretty sure I'll be able to spend some more time on Wednesday this week. I also included the full contents of zipfile.py and test_zipfile.py just in case that's useful to somebody. |
This version of the patch includes the updates to the documentation. It passes regression tests as well as the test_zipfile64 tests on my Gentoo laptop. |
Thanks for the patch. Committed as r54152. If you want to produce further changes, please submit them as new patches against the subversion trunk. Two remarks:
|
Thanks for committing. :) I will probably try adding the extract method and submit a patch for that soon. I had noticed the mode problem just a day or two ago while I was writing some more tests to improve coverage of the zipfile module, and I will include a fix for that (and the new tests) in a separate patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: