On Fri, Nov 9, 2012 at 2:18 AM, Helmut Jarausch
<(E-Mail Removed)-aachen.de> wrote:
> probably I'm missing something.
> Using str(Arg) works just fine if Arg is a list.
> 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() ?
In general, the __str__ implementations of complex data structures
will call repr() on their components, not str(). repr() normally does
not do any decoding in the first place and does not take an encoding
argument, so even if str() accepted an encoding, it wouldn't be
useful for anything.