Author haypo
Recipients haypo
Date 2008-08-20.09:00:57
SpamBayes Score 2.27618e-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:58hayposetrecipients: + haypo
2008-08-20 09:00:58hayposetmessageid: <1219222858.65.0.105309255151.issue3616@psf.upfronthosting.co.za>
2008-08-20 09:00:58haypolinkissue3616 messages
2008-08-20 09:00:57haypocreate