Python2 compatibility fix on str() function

Python2 `str` builtin function has no `encoding` parameter.