Fixing UnicodeDecodeError in python2 and python3

Fixing bytse and unicode UnicodeDecodeError between python2 and python3