Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shutil.rmtree calls onerror with different function than failed #86180

Closed
nijel mannequin opened this issue Oct 12, 2020 · 5 comments
Closed

shutil.rmtree calls onerror with different function than failed #86180

nijel mannequin opened this issue Oct 12, 2020 · 5 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@nijel
Copy link
Mannequin

nijel mannequin commented Oct 12, 2020

BPO 42014
Nosy @nijel, @tarekziade, @hynek, @serhiy-storchaka, @miss-islington
PRs
  • bpo-42014: shutil.rmtree: call onerror with correct function #22585
  • [3.9] bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585) #23228
  • [3.8] bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585) #23229
  • 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 2020-11-11.14:15:03.598>
    created_at = <Date 2020-10-12.12:54:15.411>
    labels = ['3.8', 'type-bug', 'library', '3.9', '3.10']
    title = 'shutil.rmtree calls onerror with different function than failed'
    updated_at = <Date 2020-11-11.14:15:03.598>
    user = 'https://github.com/nijel'

    bugs.python.org fields:

    activity = <Date 2020-11-11.14:15:03.598>
    actor = 'hynek'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-11-11.14:15:03.598>
    closer = 'hynek'
    components = ['Library (Lib)']
    creation = <Date 2020-10-12.12:54:15.411>
    creator = 'nijel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42014
    keywords = ['patch']
    message_count = 5.0
    messages = ['378495', '378610', '380683', '380686', '380687']
    nosy_count = 5.0
    nosy_names = ['nijel', 'tarek', 'hynek', 'serhiy.storchaka', 'miss-islington']
    pr_nums = ['22585', '23228', '23229']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue42014'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @nijel
    Copy link
    Mannequin Author

    nijel mannequin commented Oct 12, 2020

    The onerror callback is called with os.lstat when the actual failing function is os.open.

    To reproduce create directory that can not be listed:

    import os
    import shutil
    
    def onerror(func, path, exc_info):
        print(func)
    
    os.mkdir("test")
    os.chmod("test", 0)
    shutil.rmtree("test", onerror=onerror)

    @nijel nijel mannequin added 3.7 (EOL) end of life 3.10 only security fixes 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 12, 2020
    @serhiy-storchaka
    Copy link
    Member

    Added Hynek, the original committer of this code.

    @serhiy-storchaka serhiy-storchaka removed 3.7 (EOL) end of life labels Oct 14, 2020
    @miss-islington
    Copy link
    Contributor

    New changeset e59b2de by Michal Čihař in branch 'master':
    bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
    e59b2de

    @miss-islington
    Copy link
    Contributor

    New changeset c745b36 by Miss Islington (bot) in branch '3.8':
    bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
    c745b36

    @miss-islington
    Copy link
    Contributor

    New changeset 14a343a by Miss Islington (bot) in branch '3.9':
    bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
    14a343a

    @hynek hynek closed this as completed Nov 11, 2020
    @hynek hynek closed this as completed Nov 11, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants