[Python-Dev] readlink and unicode strings (SF:1580674) Patch http://www.python.org/sf/1580674 fixes readlink's behaviour w.r.t. Unicode strings: without this patch this function uses the system default encoding instead of the filesystem encoding to convert Unicode objects to plain strings. Like os.listdir, os.readlink will now return a Unicode object when the argument is a Unicode object. What I'd like to know is if this can be backported to the 2.5 branch. The first part of this patch (use filesystem encoding instead of the system encoding) is IMHO a bugfix, the second part might break existing applications (that might not expect a unicode result from os.readlink). The reason I did this patch is that os.path.realpath currently breaks when the path is a unicode string with non-ascii characters and at least one element of the path is a symlink. Ronald
M.-A. Lemburg
mal at egenix.com
Sun Oct 22 13:02:21 CEST 2006
Ronald Oussoren wrote:
> Patch http://www.python.org/sf/1580674 fixes readlink's behaviour w.r.t.
> Unicode strings: without this patch this function uses the system
> default encoding instead of the filesystem encoding to convert Unicode
> objects to plain strings. Like os.listdir, os.readlink will now return a
> Unicode object when the argument is a Unicode object.
>
> What I'd like to know is if this can be backported to the 2.5 branch.
> The first part of this patch (use filesystem encoding instead of the
> system encoding) is IMHO a bugfix, the second part might break existing
> applications (that might not expect a unicode result from os.readlink).
>
> The reason I did this patch is that os.path.realpath currently breaks
> when the path is a unicode string with non-ascii characters and at least
> one element of the path is a symlink.
I don't think that an application that passes a Unicode object to
os.readlink() would have problems dealing with a Unicode return
value.
+1 on backporting it to 2.5.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Oct 22 2006)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
More information about the Python-Dev
mailing list