Proposed strategy to port Mercurial to Python 3

Martin Geisler mg at aragost.com
Thu Nov 3 07:28:25 CDT 2011


Victor Stinner <victor.stinner at haypocalc.com> writes:

> Le mercredi 2 novembre 2011 23:08:43, vous avez écrit :
>> 
>> The short answer is that Python Unicode objects (whether they're
>> called str or unicode by Python) are completely unwelcome in the bulk
>> of the Mercurial codebase. Please see:
>> 
>> http://mercurial.selenic.com/wiki/EncodingStrategy
>
> I don't see in this document why Unicode objects are unwelcome.

One concern is the automatic promotion of str objects to unicode objects
when doing things like "s + u". That might work fine in all our test
cases but (as you know) it suddenly fails if the the s object cannot be
decoded at runtime.

> In Python 3, we cannot avoid Unicode: Unicode is everywhere, and it
> works fine.

I'm one of the developers who think we should try to make Mercurial run
on Python 3. However, it will be a lot of work, and the benefits are not
so clear: Mercurial is an application and the underlying platform should
not matter. Since Python 2.x will be around for many, many years, there
is no pressing need to "upgrade" to Python 3.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list