[Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

Thomas Heller theller at python.net
Fri Jul 1 08:45:14 CEST 2005


> Guido van Rossum:
>
>> Whoa! Do we really need a completely different mechanism for doing the
>> same stuff we can already do? 
>

Neil Hodgson <nyamatongwe at gmail.com> writes:

>    One benefit I see for the path module is that it makes it easier to
> write code that behaves correctly with unicode paths on Windows.
> Currently, to implement code that may see unicode paths, you must
> first understand that unicode paths may be an issue, then write
> conditional code that uses either a string or unicode string to hold
> paths whenever a new path is created.

Indeed.  This would probably handle the cases where you have to
manipulate file paths in code.

OTOH, Python is lacking a lot when you have to handle unicode strings on
sys.path, in command line arguments, environment variables and maybe
other places.  See, for example
http://mail.python.org/pipermail/python-list/2004-December/256969.html

I had started to work on the sys.path unicode issues, but it seems a
considerable rewrite of (not only) Python/import.c is required.  But I
fear the patch http://python.org/sf/1093253 is slowly getting out of
date.

Thomas



More information about the Python-Dev mailing list