[Python-Dev] Filename as byte string in python 2.6 or 3.0?

Gregory P. Smith greg at krypto.org
Sun Sep 28 22:34:50 CEST 2008

On 9/27/08, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>> I think that the problem is important because it's a regression from 2.5
>> to
>> 2.6/3.0. Python 2.5 uses bytes filename, so it was possible to
>> open/unlink "invalid" unicode strings (since it's not unicode but bytes).
> I'd like to stress that the problem is *not* a regression from 2.5 to 2.6.
> As for 3.0, I'd like to argue that the problem is a minor issue. Even
> though you may run into file names that can't be decoded, that happening
> really indicates some bigger problem in the management of the system
> where this happens, and the proper solution (IMO) should be to change
> the system (leaving open the question whether or not Python should
> be also changed to work with such broken systems).
> Regards,
> Martin

Note:  bcc python-dev,cc: python-3000

"broken" systems will always exist.  Code to deal with them must be
possible to write in python 3.0.

since any given path (not just fs) can have its own encoding it makes
the most sense to me to let the OS deal with the errors and not try to
enforce bytes vs string encoding type at the python lib. level.


More information about the Python-Dev mailing list