internetarchive/warctools — pull request #8 by nlevitt (2013-12-03 03:08:24+00:00)
Title: python3 support

With this pull request, the existing tests pass with python 2.7, 3.2, and 3.3. I haven't done any testing beyond the automated tests yet.

tox.ini included for testing locally against multiple versions of python (run "tox"), and .travis.yml for travis ci. https://travis-ci.org/nlevitt/warctools

I know warctools was targeted at python 2.6, but I don't have python 2.6 handy, and the tests aren't passing in travis ci, so I gave up on that for the moment.

What I really like about python3 is how it refuses to conflate raw bytes with character strings, while mostly providing the same conveniences for both (e.g. regexes). So you'll notice all the warc data, including headers, is treated as raw bytes and hopefully never decoded, which imho is the clean way to deal with it.