Bug in description handling

Dan Villiom Podlaski Christiansen danchr at gmail.com
Fri Aug 13 11:28:26 CDT 2010


On 13 Aug 2010, at 16:54, Martijn Pieters wrote:

> Strangely enough, running just the python2.5.5 interpreter without importing hgsubversion or mercurial does not show this behavior. It appears something is messing with .rstrip()'s idea of whitespace.

This appears to be caused by Mercurial calling locale.setlocale(), which affects strip() in 2.6 and earlier.

Given this little scriptlet:

print [c for c in range(256) if chr(c) != chr(c).rstrip()]
import locale
locale.setlocale(locale.LC_CTYPE, "en_US.UTF-8")
print [c for c in range(256) if chr(c) != chr(c).rstrip()]

Python 2.6.5 outputs:

[9, 10, 11, 12, 13, 32]
[9, 10, 11, 12, 13, 32, 133, 160]

And Python 2.7 outputs:

[9, 10, 11, 12, 13, 32]
[9, 10, 11, 12, 13, 32]

--

Dan Villiom Podlaski Christiansen
danchr at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1943 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100813/234f8ad4/attachment.bin>


More information about the Mercurial-devel mailing list