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 loewis, vstinner
Date 2010-09-12.16:18:47
SpamBayes Score 2.3035481e-07
Marked as misclassified No
Message-id <1284308329.34.0.00144822719653.issue9820@psf.upfronthosting.co.za>
In-reply-to
Content
> What do you gain with this patch? (i.e. what is its advantage?)

You know directly that os.listdir(bytes) is unable to encode the filename, instead of manipulate an invalid filename (b'?') and get the error later (when you use the filename: open, copy, delete, ... the file).

It's the same idea than str+bytes raises an error on Python3: get the error earlier instead of store invalid data and get the error to late.

Anywy, on Windows, it's not a good idea to manipulate bytes filenames. So it's also a way to encourage people to migrate their applications to unicode on Windows.
History
Date User Action Args
2010-09-12 16:18:49vstinnersetrecipients: + vstinner, loewis
2010-09-12 16:18:49vstinnersetmessageid: <1284308329.34.0.00144822719653.issue9820@psf.upfronthosting.co.za>
2010-09-12 16:18:47vstinnerlinkissue9820 messages
2010-09-12 16:18:47vstinnercreate