Python3.3 str() bug?

Helmut Jarausch jarausch at igpm.rwth-aachen.de
Fri Nov 9 10:18:12 CET 2012


Hi,

probably I'm missing something.

Using   str(Arg) works just fine if  Arg is a list.
But
  str([],encoding='latin-1')

gives the error
TypeError: coercing to str: need bytes, bytearray or buffer-like object, 
           list found

If this isn't a bug how can I use str(Arg,encoding='latin-1') in general.
Do I need to flatten any data structure which is normally excepted by str() ?

Many thanks for a hint,
Helmut.



More information about the Python-list mailing list