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.

Author negval
Recipients negval
Date 2015-01-29.04:52:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422507173.88.0.069796427202.issue23346@psf.upfronthosting.co.za>
In-reply-to
Content
shutil.rmtree doesn't work correctly on FreeBSD 9.1.

For example if I create a path /tmp/test and try to remove it, I get an exception:

>>> shutil.rmtree('/tmp/test')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/shutil.py", line 463, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/local/lib/python3.4/shutil.py", line 385, in _rmtree_safe_fd
    onerror(os.listdir, path, sys.exc_info())
  File "/usr/local/lib/python3.4/shutil.py", line 382, in _rmtree_safe_fd
    names = os.listdir(topfd)
OSError: [Errno 22] Invalid argument: '/tmp/test'

---

shutil._use_fd_functions has value True. When I change it to False, the shutil.rmtree works perfecty.

Version info:
>>> print(sys.version)
3.4.2 (default, Dec 22 2014, 21:56:20) 
[GCC 4.2.1 20070831 patched [FreeBSD]]
>>> print(sys.platform)
freebsd9

$ uname -r
9.1-RELEASE
History
Date User Action Args
2015-01-29 04:52:53negvalsetrecipients: + negval
2015-01-29 04:52:53negvalsetmessageid: <1422507173.88.0.069796427202.issue23346@psf.upfronthosting.co.za>
2015-01-29 04:52:53negvallinkissue23346 messages
2015-01-29 04:52:53negvalcreate