[Python 3] Fix TypeError

Fixes `TypeError: string argument expected, got 'bytes'` exception in Python 3