This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: str() on memoryview of bytearray failing on py3k
Type: Stage:
Components: Versions: Python 3.0, Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, ezio.melotti, hagen, mhammond, pitrou
Priority: normal Keywords:

Created on 2009-02-08 03:05 by mhammond, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg81363 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2009-02-08 03:05
% py30 -c "str(memoryview(bytearray((1,2,3))))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: __str__ returned non-string (type bytes)

The expected behaviour is that a string representation be returned.
msg81379 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-02-08 14:19
What sort of thing should str() on a memoryview return? Latin-1 decoded
bytes? Could we remove __str__ and just stick with __repr__?
msg81381 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-02-08 14:55
> Could we remove __str__ and just stick with __repr__?

Yes, I think it's the best thing to do.
msg81383 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-02-08 15:01
Done in r69438.
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49432
2009-02-08 15:01:19benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg81383
2009-02-08 14:55:14pitrousetmessages: + msg81381
2009-02-08 14:19:35benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg81379
2009-02-08 10:23:38hagensetnosy: + hagen
2009-02-08 08:45:25ezio.melottisetnosy: + ezio.melotti
2009-02-08 03:10:17pitrousetnosy: + pitrou
2009-02-08 03:05:41mhammondcreate