Comment 37 for bug 1013171

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

It would help a lot to keep the python hooks both python2.7 (precise) and python3 (quantal+) for the upgrade case where your hook maybe run with either pythons.

https://wiki.ubuntu.com/Python/3

Most of the time it's easy to accomplish with:
from __future__ import print_function

Which is valid in both python2.6+ and python3.

Also note:
Consider passing universal_newlines=True to subprocess.Popen() and friends to get text output directly.

Which nicely helps to deal with unicode vs bytes in python3 vs python2 cases.