Proposed strategy to port Mercurial to Python 3

Matt Mackall mpm at selenic.com
Thu Nov 3 17:22:11 CDT 2011


On Thu, 2011-11-03 at 22:56 +0100, Martin Geisler wrote:
> Victor Stinner <victor.stinner at haypocalc.com> writes:
> 
> > Le Jeudi 3 Novembre 2011 13:28:25 vous avez écrit :
> >> 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.
> >
> > Such *bug* would be easily detected during my port to Python 3. In
> > Python 2, you can find such bug by using non-ASCII characters and
> > testing various locale encodings (ASCII, latin1, UTF-8). Or you can
> > try to unicode-nazi module:
> >
> > http://pypi.python.org/pypi/unicode-nazi
> 
> Ah, that sounds line a very interesting module... thanks! We've
> discussed writing something just like that for this situation but we
> didn't realize that it already existed.

I did. But I already periodically smash the bugs this would find by
manually setting the default encoding to None, which disables automatic
Unicode promotion.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list