Skip to content

shutil.rmtree is inefficient due to listdir() instead of scandir() #72750

@enkore

Description

@enkore
mannequin
BPO 28564
Nosy @pitrou, @nh2, @serhiy-storchaka, @MojoVampire, @zhangyangyu, @enkore
PRs
  • bpo-28564: Use os.scandir() in shutil.rmtree() on Unix. #4085
  • Dependencies
  • bpo-25996: Add support of file descriptor in os.scandir()
  • Files
  • shutil-rmtree-scandir.patch
  • bench_rmtree.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-11-04.12:46:52.211>
    created_at = <Date 2016-10-30.20:02:39.210>
    labels = ['3.7', 'type-feature', 'library']
    title = 'shutil.rmtree is inefficient due to listdir() instead of scandir()'
    updated_at = <Date 2017-12-30.05:15:42.120>
    user = 'https://github.com/enkore'

    bugs.python.org fields:

    activity = <Date 2017-12-30.05:15:42.120>
    actor = 'nh2'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-04.12:46:52.211>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2016-10-30.20:02:39.210>
    creator = 'enkore'
    dependencies = ['25996']
    files = ['45382', '45619']
    hgrepos = []
    issue_num = 28564
    keywords = ['patch']
    message_count = 9.0
    messages = ['279745', '279801', '279813', '280213', '281618', '305000', '305001', '305556', '309219']
    nosy_count = 6.0
    nosy_names = ['pitrou', 'nh2', 'serhiy.storchaka', 'josh.r', 'xiang.zhang', 'enkore']
    pr_nums = ['4085']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue28564'
    versions = ['Python 3.7']

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions