[issue39327] shutil.rmtree using vagrant synched folder fails

2020-01-14 Thread Peter Liedholm


New submission from Peter Liedholm :

Python 3.6.9
Ubuntu 18.04
python3 -c 'import shutil; shutil.rmtree("1a")'
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.6/shutil.py", line 486, in rmtree
_rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib/python3.6/shutil.py", line 424, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib/python3.6/shutil.py", line 424, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib/python3.6/shutil.py", line 428, in _rmtree_safe_fd
onerror(os.rmdir, fullname, sys.exc_info())
  File "/usr/lib/python3.6/shutil.py", line 426, in _rmtree_safe_fd
os.rmdir(name, dir_fd=topfd)
OSError: [Errno 26] Text file busy: '4a'
-
Reproduction method
mkdir synched_folder\1a\2a\3a\4a
mkdir synched_folder\1a\2b\3a\4a
mkdir synched_folder\1b\2a\3a\4a
choco install vagrant
Save Vagrantfile in empty folder
vagrant box add ubuntu/bionic64
vagrant up
vagrant ssh
cd synched_folder
python3 -c 'import shutil; shutil.rmtree("1a")'
*** Error message ***
rm -r 1a
*** Works fine ***

--
components: Library (Lib)
files: Vagrantfile
messages: 359961
nosy: PeterFS
priority: normal
severity: normal
status: open
title: shutil.rmtree using vagrant synched folder fails
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48838/Vagrantfile

___
Python tracker 
<https://bugs.python.org/issue39327>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39327] shutil.rmtree using vagrant synched folder fails

2020-01-14 Thread Peter Liedholm


Peter Liedholm  added the comment:

Problem is also reported in virtualbox
https://www.virtualbox.org/ticket/19004

>From that ticket some more analysis is done;
strace reveals that Python has kept an open fd for the directory being removed.

--

___
Python tracker 
<https://bugs.python.org/issue39327>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39340] shutil.rmtree and write protected files

2020-01-15 Thread Peter Liedholm


New submission from Peter Liedholm :

Ubuntu 18.4 and Windows 7 has different behaviour when deleting write protected 
files with rmtree.

Ubuntu silently deletes them (unexpected?)
Windows moans about access denied (expected?)

Reproduction method linux
mkdir test; touch test/file.txt; chmod -w test/file.txt

Reproduction method windows
mkdir test && type nul > test\file.txt && attrib +R test\file.txt

Reproduction method cont.
python3 -c "import shutil; shutil.rmtree('test')"

--
components: Library (Lib)
messages: 360033
nosy: PeterFS
priority: normal
severity: normal
status: open
title: shutil.rmtree and write protected files
versions: Python 3.6, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue39340>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39340] shutil.rmtree and write protected files

2020-01-27 Thread Peter Liedholm


Peter Liedholm  added the comment:

What I would expect is a consistent behaviour and as a user I am not interested 
in inner guts of differences between filesystems.
Regards
/Peter

--

___
Python tracker 
<https://bugs.python.org/issue39340>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com