Fix for python 2.x compatible unicode encoding of strings

Fixes a bug where a `TypeError` is thrown in python 2.x since the `str` constructor takes at most 1 argument before python 3.x.