python 2 str switched to bytes for python 3