[New-bugs-announce] [issue3616] shutil.rmtree() fails on invalid filename
STINNER Victor
report at bugs.python.org
Wed Aug 20 11:00:58 CEST 2008
New submission from STINNER Victor <haypo at users.sourceforge.net>:
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
----------
components: Library (Lib)
messages: 71521
nosy: haypo
severity: normal
status: open
title: shutil.rmtree() fails on invalid filename
versions: Python 3.0
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3616>
_______________________________________
More information about the New-bugs-announce
mailing list