Remove unused private function shutil._ensure_directory
shutil._ensure_directory(path) has no caller and can be removed.
- [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.
A word-boundary search across Lib, Modules, Python, Objects, and Include finds no reference outside its own definition, and a GitHub code search finds no downstream importer.