Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33004

Python3.3 str() bug?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From Helmut Jarausch <jarausch@igpm.rwth-aachen.de>
Newsgroups comp.lang.python
Subject Python3.3 str() bug?
Date 9 Nov 2012 09:18:12 GMT
Lines 18
Message-ID <ag402kFkb9hU1@mid.dfncis.de> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace news.dfncis.de 73kY49q/BLzDanjMCyC0dQrUGi9TUUPryd8lQyvYyPJd1boXjwezN/a1twyO4ZK2tEMvnYDE6q
Cancel-Lock sha1:gZFnsYzHPibViuWhQPWIOtoHSMw=
User-Agent Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
Xref csiph.com comp.lang.python:33004

Show key headers only | View raw


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.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Python3.3  str() bug? Helmut Jarausch <jarausch@igpm.rwth-aachen.de> - 2012-11-09 09:18 +0000
  Re: Python3.3  str() bug? Stefan Behnel <stefan_ml@behnel.de> - 2012-11-09 10:37 +0100
    Re: Python3.3  str() bug? Helmut Jarausch <jarausch@igpm.rwth-aachen.de> - 2012-11-09 11:08 +0000
      Re: Python3.3 str() bug? Chris Angelico <rosuav@gmail.com> - 2012-11-09 23:22 +1100
        Re: Python3.3 str() bug? Helmut Jarausch <jarausch@igpm.rwth-aachen.de> - 2012-11-09 13:13 +0000
          Re: Python3.3 str() bug? Stefan Behnel <stefan_ml@behnel.de> - 2012-11-09 18:07 +0100
          Re: Python3.3 str() bug? Terry Reedy <tjreedy@udel.edu> - 2012-11-09 18:35 -0500
      RE: Python3.3 str() bug? "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-09 17:47 +0000
      Re: Python3.3 str() bug? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2012-11-10 16:45 +0000
  Re: Python3.3 str() bug? Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-09 10:25 -0700

csiph-web