Fixed python3 compat issue introduced in 80ebe9c.

Bytes need to be decoded prior to performing any string operations, such
as split/strip, on them.
Merge pull request #1798 from HapeMask/py3k-fixes

Fixed python3 compat issue introduced in 80ebe9c.