It seems that the subprocess functions return bytes rather than str for the stdout on Python 3. When this script then tries to combine them with normal strings, an exception is raised.
It seems like we either want to use bytes everywhere, or assume utf-8 encoding. The latter is a much smaller change, and probably reasonable since both git internals and (I assume) our repository text is assumed utf-8. Actual binary data seems to get base64 encoded so I don't think coincidentally-invalid utf-8 is an issue there.
Anyway, with these changes I can commit using both python3.5 and python2.7.
This is a bit wrong since it will try to print call str(b'...') behind the scenes. So if the output is "Hello, world" we'll see b'Hello world` printed.
Can you add a decode here?