This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make test.support.rmtree() able to remove non-writable directories
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: ezio.melotti, kushal.das, michael.foord, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-11-11 12:12 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test-support-rmtree.patch serhiy.storchaka, 2016-11-11 12:12 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft, 2017-03-31 16:36
Messages (8)
msg280575 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-11 12:12
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.
msg280822 - (view) Author: Kushal Das (kushal.das) * (Python committer) Date: 2016-11-15 03:34
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
msg281265 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-20 14:20
New changeset 63820871014d by Serhiy Storchaka in branch '2.7':
Issue #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 #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 #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 #28666: Now test.support.rmtree is able to remove unwritable or
https://hg.python.org/cpython/rev/3a1e75ecc17d
msg281267 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-20 14:21
Thanks Kushal.
msg281277 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-20 15:43
New changeset b51607ea54c5 by Serhiy Storchaka in branch '2.7':
Issue #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 #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 #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 #28666: Now test.support.rmtree is able to remove unwritable or
https://hg.python.org/cpython/rev/593ec9658f4b
msg281289 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-20 18:05
New changeset da1880183693 by Serhiy Storchaka in branch 'default':
Issue #28666: Try to fix removing readonly directories on Windows.
https://hg.python.org/cpython/rev/da1880183693
msg281291 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-20 18:38
New changeset 573fd9607c75 by Serhiy Storchaka in branch '3.5':
Issue #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 #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 #28666: Fix removing readonly directories on Windows.
https://hg.python.org/cpython/rev/b9e1a51a2d19
msg281308 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-20 23:24
New changeset dd378356c77c by Martin Panter in branch '2.7':
Issue #28666: Fix stat import
https://hg.python.org/cpython/rev/dd378356c77c
History
Date User Action Args
2022-04-11 14:58:39adminsetgithub: 72852
2017-03-31 16:36:26dstufftsetpull_requests: + pull_request995
2016-11-20 23:24:12python-devsetmessages: + msg281308
2016-11-20 19:37:37serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-11-20 18:38:06python-devsetmessages: + msg281291
2016-11-20 18:05:21python-devsetmessages: + msg281289
2016-11-20 15:43:26python-devsetmessages: + msg281277
2016-11-20 14:21:54serhiy.storchakasetassignee: serhiy.storchaka
messages: + msg281267
2016-11-20 14:20:56python-devsetnosy: + python-dev
messages: + msg281265
2016-11-15 03:34:50kushal.dassetnosy: + kushal.das
messages: + msg280822
2016-11-11 12:12:35serhiy.storchakacreate