Issue1927

classification
Title: BytesIO.getvalue() includes string "bytearray()"
Type: behaviour Severity: normal
Components: Core Versions: 2.7a2
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jeff.allen Nosy List: alekstorm, jeff.allen
Priority: Keywords:

Created on 2012-06-17.21:08:23 by alekstorm, last changed 2012-06-19.21:54:17 by jeff.allen.

Messages
msg7239 (view) Author: Alek Storm (alekstorm) Date: 2012-06-17.21:08:22
>>> from io import BytesIO
>>> BytesIO('abc').getvalue()
"bytearray(b'abc')"

The string "bytearray" is literally in the returned value.
msg7252 (view) Author: Jeff Allen (jeff.allen) Date: 2012-06-19.20:42:19
This is because I implemented bytearray.__repr__ and __str__ incorrectly, and been noticed elsewhere (although test_bytes.py does not catch it.)

Thanks for the simple example. In my workspace right now I get:

>dist\bin\jython
Jython 2.7.0a2+ (, Jun 19 2012, 21:25:53)
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_26
Type "help", "copyright", "credits" or "license" for more information.
>>> from io import BytesIO
>>> BytesIO('abc').getvalue()
'abc'
>>>

I expect to submit a fix this evening.
msg7253 (view) Author: Jeff Allen (jeff.allen) Date: 2012-06-19.21:54:16
Now available in the code base.
History
Date User Action Args
2012-08-18 06:20:44jeff.allenlinkissue1959 superseder
2012-06-19 21:54:17jeff.allensetstatus: open -> closed
resolution: fixed
messages: + msg7253
2012-06-19 20:42:20jeff.allensetassignee: jeff.allen
messages: + msg7252
components: + Core, - Library
nosy: + jeff.allen
2012-06-17 21:08:23alekstormcreate