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

Make test.support.rmtree() able to remove non-writable directories #72852

Closed
serhiy-storchaka opened this issue Nov 11, 2016 · 8 comments
Closed
Assignees
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 28666
Nosy @ezio-melotti, @voidspace, @serhiy-storchaka, @kushaldas
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • test-support-rmtree.patch
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2016-11-20.19:37:37.505>
    created_at = <Date 2016-11-11.12:12:35.841>
    labels = ['3.7', 'type-feature', 'tests']
    title = 'Make test.support.rmtree() able to remove non-writable directories'
    updated_at = <Date 2017-03-31.16:36:26.005>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:26.005>
    actor = 'dstufft'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2016-11-20.19:37:37.505>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2016-11-11.12:12:35.841>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['45443']
    hgrepos = []
    issue_num = 28666
    keywords = ['patch']
    message_count = 8.0
    messages = ['280575', '280822', '281265', '281267', '281277', '281289', '281291', '281308']
    nosy_count = 5.0
    nosy_names = ['ezio.melotti', 'michael.foord', 'python-dev', 'serhiy.storchaka', 'kushal.das']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue28666'
    versions = ['Python 2.7', 'Python 3.5', 'Python 3.6', 'Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    Some tests create directories with disabled writing or even reading and listing. If them fail test.support.rmtree() can't remove such directories. This cause failures in other tests.

    Proposed patch makes test.support.rmtree() able to remove such directories. If some operation fails it try to change the mode of corresponding directory and repeat the try.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Nov 11, 2016
    @kushaldas
    Copy link
    Member

    The patch looks good to me. This can be applied, and tests are running fine with the patch.

    https://ci.centos.org/job/cPython-build-patch/25/console

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 20, 2016

    New changeset 63820871014d by Serhiy Storchaka in branch '2.7':
    Issue bpo-28666: Now test.support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/63820871014d

    New changeset c92f9be77b9b by Serhiy Storchaka in branch '3.5':
    Issue bpo-28666: Now test.support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/c92f9be77b9b

    New changeset efe2993b20e2 by Serhiy Storchaka in branch '3.6':
    Issue bpo-28666: Now test.support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/efe2993b20e2

    New changeset 3a1e75ecc17d by Serhiy Storchaka in branch 'default':
    Issue bpo-28666: Now test.support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/3a1e75ecc17d

    @serhiy-storchaka
    Copy link
    Member Author

    Thanks Kushal.

    @serhiy-storchaka serhiy-storchaka self-assigned this Nov 20, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 20, 2016

    New changeset b51607ea54c5 by Serhiy Storchaka in branch '2.7':
    Issue bpo-28666: Now test.test_support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/b51607ea54c5

    New changeset 9e23b8996584 by Serhiy Storchaka in branch '3.5':
    Issue bpo-28666: Now test.support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/9e23b8996584

    New changeset 82ca763882f5 by Serhiy Storchaka in branch '3.6':
    Issue bpo-28666: Now test.support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/82ca763882f5

    New changeset 593ec9658f4b by Serhiy Storchaka in branch 'default':
    Issue bpo-28666: Now test.support.rmtree is able to remove unwritable or
    https://hg.python.org/cpython/rev/593ec9658f4b

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 20, 2016

    New changeset da1880183693 by Serhiy Storchaka in branch 'default':
    Issue bpo-28666: Try to fix removing readonly directories on Windows.
    https://hg.python.org/cpython/rev/da1880183693

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 20, 2016

    New changeset 573fd9607c75 by Serhiy Storchaka in branch '3.5':
    Issue bpo-28666: Fix removing readonly directories on Windows.
    https://hg.python.org/cpython/rev/573fd9607c75

    New changeset 01f867e9cd34 by Serhiy Storchaka in branch '2.7':
    Issue bpo-28666: Fix removing readonly directories on Windows.
    https://hg.python.org/cpython/rev/01f867e9cd34

    New changeset b9e1a51a2d19 by Serhiy Storchaka in branch '3.6':
    Issue bpo-28666: Fix removing readonly directories on Windows.
    https://hg.python.org/cpython/rev/b9e1a51a2d19

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 20, 2016

    New changeset dd378356c77c by Martin Panter in branch '2.7':
    Issue bpo-28666: Fix stat import
    https://hg.python.org/cpython/rev/dd378356c77c

    @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.7 (EOL) end of life tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants