[PATCH 5 of 5 RFC py3 support] run-tests: minimum changes required to make run-tests work in python3

Augie Fackler raf at durin42.com
Thu Sep 19 17:06:23 CDT 2013


On Sep 19, 2013, at 4:53 PM, Matt Mackall <mpm at selenic.com> wrote:

> On Thu, 2013-09-19 at 16:37 -0400, Augie Fackler wrote:
>> 
>> On Thu, Sep 19, 2013 at 4:36 PM, Matt Mackall <mpm at selenic.com> wrote:
>>> This is just doing the dumbest thing possible and assumes
>>        test
>>> input/output is all utf-8. This works for now, at least for
>>        the simple
>>> tests I'm interested in trying to run, so I'm calling it
>>        progress
>>> until I have to come back and figure out something smarter.
>> 
>> 
>>        Please tell me this doesn't mean subprocess can't return byte
>>        streams in
>>        3.x.
>> 
>> 
>> 
>> I haven't looked at all. I'm literally doing the dumbest thing
>> possible to try and get to 'hg version' with a working testsuite.
> 
> Ok. Let's learn a bit more before proceeding. A quick test here with
> Py3.2 shows that subprocess pipe fds are in fact in byte mode.

Oh, dur. I forgot between writing the patch and responding what's going on here. What we're doing is manipulating the test content in string form, then encoding to bytes and writing, executing, then taking the bytes from the successful test run and converting it back to a string for feeding to difflib.

I think Python 3.4 will come with a difflib patch that adds support for bytes to difflib, which will be good progress, but for the mean time this at least lets us test hg using run-tests on 3.x and chip at getting something basic (probably 'hg version') working.

> 
> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130919/f5c3c544/attachment.pgp>


More information about the Mercurial-devel mailing list