[Python-Dev] Python-3.0, unicode, and os.environ

Scott Dial scott+python-dev at scottdial.com
Mon Dec 8 20:39:13 CET 2008


Guido van Rossum wrote:
> On Mon, Dec 8, 2008 at 10:34 AM,  <rdmurray at bitdance.com> wrote:
>> On Mon, 8 Dec 2008 at 13:16, Terry Reedy wrote:
>>>>  And the decoding problems don't pass silently either - they just get
>>>>  emitted as a warning by default instead of causing the application to
>>>>  crash.
>>> Do they get automatically logged?  In any case, the errors parameter has
>>> an in between option to neither ignore or raise but to replace and give
>>> *something* printable.
>>
>> I just really really don't want the _default_ to be "ignore".  Defaulting
>> to a warning is fine with me, as would be defaulting to a traceback.
> 
> Do you really not care about the risk where apps that weren't written
> to be prepared to handle this will be rendered completely useless if a
> single file in a directory has an unencodable name?

Since when do warnings cause apps to be rendered completely useless? I
think it's easy to agree that defaulting to an exception is not good for
the reason you give, but I don't see how that applies to a warning. And,
it seems like a warning covers the issues that the other people want as
well. If there is a warning, then there is at least a record of the fact
that some filenames were ignored. Presumably if I was responsible for
the correctness of some piece of code, I would see the warning in a log
of some sort and could investigate it further (if I cared), otherwise I
could choose to ignore it. I don't see os.listdir(name) to be one of
those situations that emitting a warning is a nuisance at all.

-Scott

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu


More information about the Python-Dev mailing list