Practical Python Porting for systems programmers

Last week I decided the time had come to bite the bullet and systematically port the fairly large volume of Python code I maintain from Python 2 to Python 3.


I straightaway ran into a problem, which is that for my purposes the Web resources on on how to do this are pretty awful. And not just in the general, unsurprising sense of being way too full of theory and generality and way too light on practical advice, either.


No, there’s a more specific problem as well. I write systems programs, things like SRC and reposurgeon that have to be able to do string-bashing-like things on binary data without upchucking or (worse) silently mangling that data.


Due to the Python 3 decision that strings are sequences of Unicode code points rather than bytes, this is significantly more difficult in Python 3 than it was in Python 2.



However, it is possible. When A&D regular Peter Donis volunteered to help me with my porting troubles, I proposed to him that we should write a HOWTO on the process.


That HOWTO now exists: Practical Python Porting for systems programmers.


The HOWTO points to SRC and reposurgeon as worked examples, and there are new releases of both to accompany it.

 •  0 comments  •  flag
Share on Twitter
Published on February 25, 2016 02:49
No comments have been added yet.


Eric S. Raymond's Blog

Eric S. Raymond
Eric S. Raymond isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Eric S. Raymond's blog with rss.