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 gvanrossum
Recipients HWJ, amaury.forgeotdarc, benjamin.peterson, gvanrossum, pitrou, vstinner
Date 2008-08-21.23:59:06
SpamBayes Score 8.139297e-05
Marked as misclassified No
Message-id <ca471dc20808211658q739d72d5p7afae281f71324e2@mail.gmail.com>
In-reply-to <1afaf6160808211635u7646decfx59382760312ca619@mail.gmail.com>
Content
>> I do not accept an os.listdir() that raises an error because one
>> filename cannot be decoded.  It sounds like using errors='replace' is
>> also wrong -- so the only solution is for os.listdir() to skip files it
>> cannot decode.  While this doesn't help for rmtree(), it is better than
>> errors='replace' for code that descends into the tree looking for files
>> matching a pattern or other property.  So I propose this as a patch for 3.0.
>
> As much as this maybe the right idea, I don't like the idea of
> silently losing the contents of a directory. That's asking for
> difficult to discover bugs.

Well, the other approaches also cause difficult to discover bugs (the
original bug report here was an example :-).

> Could Python emit a warning in this case?

This may be the best compromise yet. It would have to use the warnings
module so that you could disable it.
History
Date User Action Args
2008-08-21 23:59:10gvanrossumsetrecipients: + gvanrossum, amaury.forgeotdarc, pitrou, vstinner, benjamin.peterson, HWJ
2008-08-21 23:59:08gvanrossumlinkissue3187 messages
2008-08-21 23:59:07gvanrossumcreate