[Urwid] Urwid and Python 3

Ian Ward ian at excess.org
Wed Aug 4 22:47:16 EDT 2010

Wendell Smith wrote on 2010-08-04 16:00:
>   Hi,
> I contacted this list earlier to ask about python 3, and it sounded like 
> you all had enough work to do without worrying about it. Since I would 
> like to use urwid for an ipython interpreter, and ipython wants to 
> switch to python 3 as soon as possible, I thought I might see how well 
> it works to switch urwid over to python 3... and after trying it out, I 
> have a fairly well working python 3 version of urwid!

Thanks, I did notice you working on that in github.

> Its available at http://github.com/wackywendell/urwid
> Or if you're using git:
> $ git clone git://github.com/wackywendell/urwid.git
> Its setup to use the recommended way of converting to python 3: the code 
> posted is working py2.6 code, and if you run the 2to3 converter on it, 
> it should give you working python3 code. There is a script called 
> '23dir' in there as well, which runs through the urwid directory, and 
> copies everything to an urwid3 directory. When its done, there should be 
> a working python3 implementation.

That sounds like what we need.  There is a python3 branch in the hg
repository that Kirk Mcdonald was working on a few months ago, but I
don't think his was split into 2.6 version + script.


I wasn't able to push that branch to git when I tried. (my hg-git-fu
wasn't strong enough)

Maybe there are useful changes in there for your fork?

> I say its working... and it is: run python tour.py, and it works, even 
> with unicode characters. At least, on my machine, with European unicode 
> characters. I'm pretty sure I've killed any support for wide characters 
> (because I don't understand how that worked, sorry.) It also doesn't 
> pass many of the unit tests in python3... but, well, I'm not done, I 
> just tried out the conversion to see how feasible it was.

I believe Kirk said the unit tests were passing on his branch.

> Anyways, please tell me what you think!

It's great to see this effort.  If it's working well enough I would
really like the next Urwid release to include this.


More information about the Urwid mailing list