[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

Ronald Oussoren ronaldoussoren at mac.com
Sun Oct 22 12:54:54 CEST 2006


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3562 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-dev/attachments/20061022/b5aee3b7/attachment.bin 


More information about the Python-Dev mailing list