osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ypeError: decoding str is not supported


Hi,

I have some code comes from python 2 like the following:

str('a', encoding='utf-8')

But for python 3, this will fail as follows:

>>> str('a', encoding='utf-8')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: decoding str is not supported


How to fix it?