I’ve spent the better part of today and some of Monday and Tuesday hunting down why so many tests in brain are failing. While I haven’t completely followed the tracebacks of every single error or failure, I can say that for those that I have, the problem does not appear to be caused by lib3to2, but rather by what I can only explain as differences in the sqlite3 module between the Python3.1 version and the Python2.7 versions. This suggests that there might still be some work to do with lib3to2.
However, I really don’t see a possible lib3to2-based solution for this. I wouldn’t even know where to start with this, since sqlite3 is just a thin wrapper around _sqlite3, a C extension module included with Python. I’m going to tentatively call this one finished, after I fix a bug involving print statements and parentheses. It shows that even though lib3to2 is pretty good at syntax refactoring, there are some differences (often very subtle) between Python3 and Python2 that lib3to2 will fail to catch and will need manual refactoring (and it’s thanks to brain’s excellent test suite that I found those in the first place!). Furthermore, lib3to2 is best used as an aid throughout the entire development process, as it will catch incompatibility problems early, before too much code starts building on incompatible code.
I’m also running 3to2′d code with Python 2.7, so there may be some additional problems with Python 2.6 and earlier.