Open
Description
Punchline: from builtins import str; str(unidecode(str('2b or not 2b')))
"b'2b or not 2b'"
>>> from unidecode import unidecode
>>> str(unidecode(str('2b or not 2b'))) # no problem
'2b or not 2b'
>>> from builtins import str
>>> str(unidecode(str('2b or not 2b'))) # big problem
"b'2b or not 2b'"
>>> str(str('2b or not 2b')) # str recursively all you want
'2b or not 2b'
>>> unidecode(str('2b or not 2b')) # `newbyte` obj is `repr`ed by unidecode
b'2b or not 2b'
>>> unidecode('2b or not 2b')
'2b or not 2b'
>>> unidecode(unidecode('2b or not 2b'))
'2b or not 2b'
>>> unidecode(unidecode(b'2b or not 2b'))
'2b or not 2b'
>>> unidecode(unidecode(str('2b or not 2b'))) # because future.builtins creates a newbytes type
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
...
AttributeError: encode method has been disabled in newbytes
>>> unidecode(str('2b or not 2b'))
b'2b or not 2b'
Metadata
Metadata
Assignees
Labels
No labels