[IronPython] Mercurial Status

Jeff Hardy jdhardy at gmail.com
Wed May 6 01:57:41 CEST 2009


On Mon, May 4, 2009 at 2:13 PM, Dino Viehland <dinov at microsoft.com> wrote:
> You mention bug #22258 - is Mercurial using byte array notation wherever
> they intend to have a non-Unicode string?

Turns out, I thought buffers == byte arrays, but apparently they're
not. I also managed to mix up changes that are in 3.0 with what went
in to 2.6 (I thought file.read() returned a byte[] in 2.6...nope).
I've just thoroughly confused myself. Whee.

It still repros if you use b = buffer(...); my description is just wrong.

However, Mercurial does not use b'', since they have to be compatible
with more than 2.6.

>
> 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.

I don't think there are many places where b'' would be necessary. Most
of the intersting data in Mercurial is read from files and handled in
chunks (using struct.pack/unpack), or at least the stuff I've dealt
with so far. It looks like calling str() on a buffer should just
return the underlying string data, but I'm not sure.

The changes to PythonFile don't look as bad as I thought, so maybe
I'll play with it a bit and see if writing the buffers to file
directly helps at all.

- Jeff



More information about the Ironpython-users mailing list