[Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

Georg Brandl g.brandl at gmx.net
Tue Sep 30 19:32:34 CEST 2008


Steven D'Aprano schrieb:
> On Tue, 30 Sep 2008 11:50:10 pm Guido van Rossum wrote:
> 
>> > To avoid silent skipping, is it possible to drop 'unreadable'
>> > names, issue a warning (instead of exception), and continue to
>> > completion? "Warning: unreadable filename skipped; see
>> > PyWiki/UnreadableFilenames"
>>
>> That would be annoying as hell in most cases.
> 
> Doesn't the warning module default to only displaying the warning once 
> per session? I don't see that it would be annoying as hell to be 
> notified once per session that an error has occurred.
> 
> What I'd find annoying as hell would be something like this:
> 
> $ ls . | wc -l
> 25
> $ python
> ....
>>>> import os
>>>> len(os.listdir('.')
> 24
> 
> 
> Give me a nice clear error, or even a warning. Don't let the error pass 
> silently, unless I explicitly silence it.

Just another data point: I've just looked at Qt, which provides a filesystem
API and whose strings are Unicode, and it seems to drop undecodable filenames
as well.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list