Quotation-tools: porting to Python3
Aug. 23rd, 2012 09:58 pmI've ported 2 of the intended 3 libraries for my PyCarolinas talk. The third is my own quotation-tools, and it's not a port that 2to3 can handle: strings and Unicode are entangled throughout, many methods have
encoding
parameters because they're returning what Python 3 calls 'bytes', and several of the scripts produced XML through print statements.
There's no way to rewrite this code automatically, so tonight I just dived in, read through it fixing stuff, and then ran the test suite and scripts and fixed more problems until everything worked.
I think this port is at least good enough to let me flesh out that section of my talk. Larger rewrites, such as generating XML through producing a proper tree, can wait until after the talk is done.