Message71521
If the directory contains invalid filenames (invalid in the system
charset), an exception is raised by os.path.join() used by
shutil.rmtree():
fullname = os.path.join(path, name)
File "/home/haypo/prog/py3k/Lib/posixpath.py", line 64, in join
if b.startswith('/'):
TypeError: expected an object with the buffer interface
name is an bytes object, not a str object. My system charset is utf-8.
Example to reproduce the problem:
mkdir x
# create a file with an invalid name
touch -- $(echo -e 'x/--\0250--')
python -c "import shutils; shutil.rmtree('x')"
=> TypeError: expected an object with the buffer interface |
|
| Date |
User |
Action |
Args |
| 2008-08-20 09:00:58 | haypo | set | recipients:
+ haypo |
| 2008-08-20 09:00:58 | haypo | set | messageid: <1219222858.65.0.105309255151.issue3616@psf.upfronthosting.co.za> |
| 2008-08-20 09:00:58 | haypo | link | issue3616 messages |
| 2008-08-20 09:00:57 | haypo | create | |
|