gh-150885: Remove unused shutil._ensure_directory#150883
Open
gaborbernat wants to merge 1 commit into
Open
Conversation
Introduced in python#8295 alongside shutil.unpack_archive() as a helper that created the parent directory of each extracted member. Orphaned by pythongh-146581 (pythonGH-146591), the ZIP path-traversal fix, which reworked _unpack_zipfile() to create directories inline and deleted the last _ensure_directory(targetpath) call site in the same change. Since then the private helper has had no caller: a word-boundary search across Lib, Modules, Python, Objects and Include finds zero references outside its own definition, and a GitHub code search finds no downstream importers.
448cb74 to
5de9387
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
shutil._ensure_directory()arrived in #8295 withshutil.unpack_archive(), where it created the parent directory of each extracted member. The ZIP path-traversal fix in gh-146581 (GH-146591) reworked_unpack_zipfile()to create directories inline and removed the last call to it, so the private helper now has no caller.Nothing in the repository references the name outside its own definition, found by a word-boundary search across
Lib,Modules,Python,Objects, andInclude, and a GitHub code search turns up no downstream importer._ensure_directoryis private and undocumented, so this has no user-facing effect and needs noMisc/NEWS.dentry. Theskip newslabel applies.