[issue22040] Add a "force" parameter to shutil.rmtree

2016-05-18 Thread Nirbheek Chauhan
Nirbheek Chauhan added the comment: > In other words, on unix shutil.rmtree is *already* 'rm -rf'. This is not true. See: $ mkdir testdir && chmod 200 testdir && ls -lhd testdir d-w--- 2 nirbheek nirbheek 4.0K May 19 10:21 testdir `rm -rf` works fine on this. But shutil.rmtree borks:

[issue22040] Add a force parameter to shutil.rmtree

2014-07-22 Thread Paul Moore
New submission from Paul Moore: It would be useful for shutil.rmtree to have a force argument that overrode read-only permission issues, essentially replicating the behaviour of the -f flag in rm -rf (Unix) and the -force parameter of del (Windows Powershell). It's possible to use the onerror

[issue22040] Add a force parameter to shutil.rmtree

2014-07-22 Thread Charles-François Natali
Charles-François Natali added the comment: On Unix at least, this doesn't apply: rm -f doesn't mean ignore permissions, but but rather don't ask confirmation which the rm commands asks in some cases (empty file, directory, etc). Ans the code posted wouldn't work, since the permission to remove

[issue22040] Add a force parameter to shutil.rmtree

2014-07-22 Thread R. David Murray
R. David Murray added the comment: Actually it does apply on unix: rdmurray@session:~/tmpls -ld foo drwxr-x--- 2 rdmurray rdmurray 4096 Jul 22 16:09 foo rdmurray@session:~/tmpls -l foo total 0 -r--r- 1 rdmurray rdmurray 0 Jul 22 16:09 bar rdmurray@session:~/tmprm -r foo rm: remove

[issue22040] Add a force parameter to shutil.rmtree

2014-07-22 Thread Charles-François Natali
Charles-François Natali added the comment: Actually it does apply on unix: No, it does not apply: here's what I've written: rm -f doesn't mean ignore permissions, but but rather don't ask confirmation which the rm commands asks in some cases (empty file, directory, etc). Having a file

[issue22040] Add a force parameter to shutil.rmtree

2014-07-22 Thread R. David Murray
R. David Murray added the comment: In other words, on unix shutil.rmtree is *already* 'rm -rf'. This then argues that it *not* deleting read only files on Windows is a bug, albeit one we may not be able to fix for backward compatibility reasons. Ah, and now my memory is jogged. This is a

[issue22040] Add a force parameter to shutil.rmtree

2014-07-22 Thread Paul Moore
Paul Moore added the comment: Doh. And I was even involved in the previous issue. Sorry for the noise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22040 ___

[issue22040] Add a force parameter to shutil.rmtree

2014-07-22 Thread Charles-François Natali
Charles-François Natali added the comment: In other words, on unix shutil.rmtree is *already* 'rm -rf'. Exactly :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22040 ___