Ok, I do have a fix for this and the other issues - I'm just waiting for
a code review then I'll check it in. If we do f.write(buffer('foo')) where
f was opened as a binary file we'll write out b'foo' and not
b'f\x00o\x00\x00' which I suspect will work for your purposes (but won't be
compatible w/ buffer(u'foo').
I also have the fixes for the other issues you reported so hopefully
you'll be largely unblocked to find the next set of issues soon :)
> -----Original Message-----
> From: [email protected] [mailto:users-
> [email protected]] On Behalf Of Jeff Hardy
> Sent: Tuesday, May 05, 2009 4:58 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] Mercurial Status
>
> On Mon, May 4, 2009 at 2:13 PM, Dino Viehland <[email protected]>
> 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
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com