Remove private stdlib helpers orphaned by past removals #150882
Copy link
Copy link
Closed
Description
Bug report / cleanup
Two private helpers lost their last caller when a feature was removed and now sit unused. A word-boundary search across Lib, Modules, Python, Objects, and Include finds no reference to either outside its own definition, and a GitHub code search finds no downstream importer.
shutil._ensure_directory(path)
- [3.6] bpo-33967: Remove use of deprecated assertRaisesRegexp() (GH-8261) #8295 added it with
shutil.unpack_archive()to create the parent directory of each extracted member. - gh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows #146591 (shutil.unpack_archive() on Windows writes outside extract_dir for ZIP entries with drive-prefixed names #146581), the ZIP path-traversal fix, reworked
_unpack_zipfile()to create directories inline and deleted the last_ensure_directory(targetpath)call.
importlib._bootstrap._object_name(obj)
- gh-70319: Deprecate usage of load_module() #23469 (bpo-26131) added it to render an object's qualified name inside the
load_module()deprecation warnings. - Meta issue for cleaning up import system cruft #97850 (GH-97850: Remove all uses and definitions of
load_module()from importlib #142205) removedload_module()and its warnings, deleting the last call site.
I will open one PR per module. Both removals keep the existing test suites green (test_shutil, test_importlib).
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
pythongh-150882: Remove unused importlib._bootstrap._object_name
pythongh-150882: Remove unused shutil._ensure_directory
gaborbernat commentedon Jun 3, 2026
Superseded by one issue per topic: #150885 (shutil._ensure_directory) and #150886 (importlib._bootstrap._object_name). Closing this combined issue.