Encoding of file names

Tom Anderson twic at urchin.earth.li
Fri Dec 9 19:08:18 EST 2005


On Fri, 9 Dec 2005, "Martin v. Löwis" wrote:

> Tom Anderson wrote:
>
>> Isn't the key thing that Windows is applying a non-roundtrippable 
>> character encoding?
>
> This is a fact, but it is not a key thing. Of course Windows is applying 
> a non-roundtrippable character encoding. What else could it do?

Well, i'm no great thinker, but i'd say that errors should never pass 
silently, and that in the face of ambiguity, one should refuse the 
temptation to guess. So, as i said in my post, if the name couldn't be 
translated losslessly, an error should be raised.

>> I don't know what Windows *should* do here. I know it shouldn't do this 
>> - this leads to breaking of some very basic invariants about files and 
>> directories, and so the kind of confusion utabintarbo suffered.
>
> It always did this, and always will. Applications should stop using the 
> *A versions of the API.

Absolutely true.

> If they continue to do so, they will continue to get bogus results in 
> border cases.

No. The availability of a better alternative is not an excuse for 
gratuitous breakage of the worse alternative.

tom

-- 
Whose house? Run's house!


More information about the Python-list mailing list