The problem is the different way `stdin` behaves in the two python versions. Find a way to get python2's `stdin` to reliably give us `bytes` instead of `unicode`