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-13.11:50:44
SpamBayes Score 1.8021695e-11
Marked as misclassified No
Message-id <1284378647.15.0.27430372978.issue9820@psf.upfronthosting.co.za>
In-reply-to
Content
> I fail to see why removing incorrect file names from the result
> list is any better than keeping them. The result list will 
> be incorrect either way.

It depends if you focus on displaying the content of the directory, or on processing files and directories. If you focus on display, yes, missing files an be seen as a bug. But if you walk into directories (use cases: os.walk(), replace a text pattern in all files (~os.glob), ...), and the function raises an error (because a directory or a file name is invalid) is worse. I mean the user have to rename all unencodable names, or the devfeloper have to patch its application to catch IOError and ignore the specific IOError(22).

If listdir() ignores unencodable names, os.walk() doesn't fail, but it misses some subdirectories and files.

--

Another (worse?) idea: deny bytes path for os.listdir(), but I suppose that we will not like the idea ;-)
History
Date User Action Args
2010-09-13 11:50:48vstinnersetrecipients: + vstinner, loewis
2010-09-13 11:50:47vstinnersetmessageid: <1284378647.15.0.27430372978.issue9820@psf.upfronthosting.co.za>
2010-09-13 11:50:45vstinnerlinkissue9820 messages
2010-09-13 11:50:44vstinnercreate