On Sat, 28 Sep 2019 at 10:53, Peter Otten <__pete...@web.de> wrote:
>
> Hongyi Zhao wrote:
>
> > Hi,
> >
> > I have some code comes from python 2 like the following:
> >
> > str('a', encoding='utf-8')
>
> This fails in Python 2
>
> >>> str("a", encoding="utf-8")
> Traceback (most recent call last):
Hongyi Zhao wrote:
> Hi,
>
> I have some code comes from python 2 like the following:
>
> str('a', encoding='utf-8')
This fails in Python 2
>>> str("a", encoding="utf-8")
Traceback (most recent call last):
File "", line 1, in
TypeError: str() takes at most 1 argument (2 given)
...unless yo
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 "", line 1, in
TypeError: decoding str is not supported
How to fix it?
--
https://m