[PATCH 1 of 2] encoding: use s.decode to trigger UnicodeDecodeError

Martin Geisler martin at geisler.net
Mon Jul 23 17:23:17 CDT 2012


Adrian Buehlmann <adrian at cadifra.com> writes:

> On 2012-07-23 22:59, Martin Geisler wrote:
>> # HG changeset patch
>> # User Martin Geisler <mg at aragost.com>
>> # Date 1343076802 21600
>> # Branch stable
>> # Node ID 483526b958bcbc483f00f559db0de7221067dc12
>> # Parent  d1b49b02bc161faed1f397cb8fe13a38299bbc01
>> encoding: use s.decode to trigger UnicodeDecodeError
>> 
>> When calling encode on a str, the string is first decoded using the
>> default encoding and then encoded. So
>> 
>>   s.encode('ascii') == s.decode().encode('ascii')
>> 
>> We don't care about the encode step here -- we're just after the
>> UnicodeDecodeException raised by decode if it finds a non-ASCII
>   UnicodeDecodeError exception raised by ...

Thanks! I fixed this and pushed the patches to crew.

-- 
Martin Geisler

aragost Trifork
Commercial Mercurial support
http://aragost.com/mercurial/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120724/2f459f07/attachment.pgp>


More information about the Mercurial-devel mailing list