Python 3 porting guide: str.decode does not exist; str.encode was meant