[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-10-03 Thread Jason R. Coombs
Change by Jason R. Coombs : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-10-03 Thread Jason R. Coombs
Jason R. Coombs added the comment: Fix merged into master. Please use zipp 3.2.0 on Python 3.9 and earlier for the improved behavior or report back here if a backport is needed (and why). -- stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 ___

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-10-03 Thread Jason R. Coombs
Jason R. Coombs added the comment: New changeset ebbe8033b1c61854c4b623aaf9c3e170d179f875 by Jason R. Coombs in branch 'master': bpo-40564: Avoid copying state from extant ZipFile. (GH-22371) https://github.com/python/cpython/commit/ebbe8033b1c61854c4b623aaf9c3e170d179f875 -- _

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-09-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've released zipp 3.2.0 that includes a fix for this issue (option 2). Please test it out. Because this change affects the user's expectation about the effect of what's passed in, I'm hesitant to backport it to 3.8 and 3.9. It's too late to go into 3.9.0,

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-09-22 Thread Jason R. Coombs
Change by Jason R. Coombs : -- keywords: +patch pull_requests: +21408 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22371 ___ Python tracker ___

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-09-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've also created this alternative to option 2: - https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-mixin This alternative approach uses a mix-in rather than subclasses, creating a new class on-demand. I was hoping this approach would enable just augment

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-09-09 Thread Jason R. Coombs
Jason R. Coombs added the comment: In jaraco/zipp, I've implemented three of the options above: - https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-option-1 - https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-option-2 - https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-option-5 -

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: Implementing that last option: ``` diff --git a/zipp.py b/zipp.py index 697d4a9..f244cba 100644 --- a/zipp.py +++ b/zipp.py @@ -111,6 +111,7 @@ class CompleteDirs(zipfile.ZipFile): res = cls.__new__(cls) vars(res).update(vars(source)) +

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: I see a few options here: - Implement CompleteDirs/FastLookup as adapters instead of subclasses, allowing the original ZipFile object to represent the state in a single place. This approach would likely be slower due to the indirection on all operations th

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: I suspect the issue lies in how the CompleteDirs.make [replaces one instance with another](https://github.com/jaraco/zipp/blob/8ad959e61cd4be40baab93528775c2bf03c8f4e1/zipp.py#L112-L114) in order to provide a complete list of implied directories and to memo

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: I am able to replicate the failure using the ondisk fixture: ```diff diff --git a/test_zipp.py b/test_zipp.py index a6fbf39..539d0a9 100644 --- a/test_zipp.py +++ b/test_zipp.py @@ -259,3 +259,11 @@ class TestPath(unittest.TestCase): def test_implied_dir

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've attempted to replicate the issue in the [zipp](https://github.com/jaraco/zipp) test suite with this test: ```diff diff --git a/test_zipp.py b/test_zipp.py index a6fbf39..dc7c8aa 100644 --- a/test_zipp.py +++ b/test_zipp.py @@ -259,3 +259,10 @@ class Tes

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Bisection show this to be caused due to e5bd73632e77dc5ab0cab77e48e94ca5e354be8a . See also issue41640 for a similar report. -- nosy: +xtreak ___ Python tracker

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-05-08 Thread Brett Cannon
Change by Brett Cannon : -- nosy: +jaraco ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-05-08 Thread Xavier
New submission from Xavier : Given a .zip file with more than one inner file, when reading those inner files using zipfile.Path the zip module closes the .zip file prematurely, causing an error. Given the following code (example zipfile is attached, but any should work). with zipfile.ZipFile