[IronPython] Mercurial Status

Dino Viehland dinov at microsoft.com
Mon May 4 22:13:38 CEST 2009


You mention bug #22258 - is Mercurial using byte array notation wherever
they intend to have a non-Unicode string?  I'm just curious because there
may be a lot of other subtle Unicode issues.  For example:

foo = open('foo', 'w+b')
b = buffer(u'hello world', 6)
foo.write(b)
foo.close()

in CPython doing readlines brings back:

['l\x00o\x00 \x00w\x00o\x00r\x00l\x00d\x00']

For us this is the same as doing b = buffer('hello world', 6) - which in
CPython returns 'world' as one would expect.  So I'm thinking we should 
match the Unicode string behavior here but that could break something else.

But as long as Mercurial is consistently using b'' for its non-Unicode 
strings then things will work.  Hopefully if they're not they'd look 
upon those changes as just being goodness for 3.x compat.

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy
> Sent: Saturday, May 02, 2009 12:24 PM
> To: Discussion of IronPython
> Subject: [IronPython] Mercurial Status
> 
> I've been testing IronPython with Mercurial. Using the 2.6 nightlies as
> the base, lots of it will "just work". (Make sure you grab zlib from
> http://cid-
> 414fa1a9bd174b4b.skydrive.live.com/self.aspx/Public/IronPython.Zlib.zip
> ).
> The attached patch moves things a little further on. Also, you'll need
> to use the pure modules.
> 
> Basic stuff like hg status or hg version will work, but hg clone is the
> first problematic command I ran into.
> 
> The current bugs are:
>  - #13702 - Support errno interface in error derived from
> EnvironmentError
>  - #22258 - _sha does not support 2.6 byte buffers
>  - #22259 - len(buffer) is incorrect
>  - #22260 - Cannot write buffer to file
> 
> I ran into a unicode error caused by the workarounds for #22260
> (converting randow binary data to a string doesn't always seem to
> work...), so that's kind of the showstopper right now.
> 
> - Jeff



More information about the Ironpython-users mailing list