New submission from STINNER Victor <[EMAIL PROTECTED]>:

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 <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3616>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to