[3.8] bpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170) #15461
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix Path._add_implied_dirs to include all implied directories
fix Path._add_implied_dirs to include all implied directories
Optimize code by using sets instead of lists
📜🤖 Added by blurb_it.
fix Path._add_implied_dirs to include all implied directories
Optimize code by using sets instead of lists
📜🤖 Added by blurb_it.
Add tests to zipfile.Path.iterdir() fix
Update test for zipfile.Path.iterdir()
remove whitespace from test file
Rewrite NEWS blurb to describe the user-facing impact and avoid implementation details.
remove redundant [] within set comprehension
Update to use unique_everseen to maintain order and other suggestions in review
remove whitespace and add back add_dirs in tests
Add new standalone function parents using posixpath to get parents of a directory
removing whitespace (sorry)
Remove import pathlib from zipfile.py
Rewrite _parents as a slice on a generator of the ancestry of a path.
Remove check for '.' and '/', now that parents no longer returns those.
Separate calculation of implied dirs from adding those
Re-use _implied_dirs in tests for generating zipfile with dir entries.
Replace three fixtures (abcde, abcdef, abde) with one representative example alpharep.
Simplify implementation of _implied_dirs by collapsing the generation of parent directories for each name.
(cherry picked from commit a4e2991)
Co-authored-by: shireenrao shireenrao@gmail.com
https://bugs.python.org/issue37772