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 vstinner
Recipients vstinner
Date 2008-08-20.09:00:57
SpamBayes Score 2.2761842e-05
Marked as misclassified No
Message-id <1219222858.65.0.105309255151.issue3616@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2008-08-20 09:00:58vstinnersetrecipients: + vstinner
2008-08-20 09:00:58vstinnersetmessageid: <1219222858.65.0.105309255151.issue3616@psf.upfronthosting.co.za>
2008-08-20 09:00:58vstinnerlinkissue3616 messages
2008-08-20 09:00:57vstinnercreate