GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove unused private function shutil._ensure_directory · Issue #150885 · python/cpython

Remove unused private function shutil._ensure_directory #150885

New issue
Copy link
New issue
Copy link
Closed
Closed
Remove unused private function shutil._ensure_directory#150885
Copy link
Labels
3.16new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

Description

@gaborbernat
gaborbernat
opened on Jun 3, 2026
Issue body actions

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.

Activity

  1. gaborbernat
    added a commit that references this issue on Jun 3, 2026

    pythongh-150885: Remove unused shutil._ensure_directory

    5de9387
  2. picnixz
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
    on Jun 3, 2026
  3. serhiy-storchaka
    added a commit that references this issue on Jun 7, 2026

    gh-150885: Remove unused shutil._ensure_directory (GH-150883)

    e5ced1f
  4. serhiy-storchaka
    closed this as completedon Jun 7, 2026
  5. serhiy-storchaka
    added
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    on Jun 7, 2026
  6. philthompson10
    added a commit that references this issue on Jun 17, 2026

    pythongh-150885: Remove unused shutil._ensure_directory (pythonGH-150883

    77b5cd3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.