Issue2011

classification
Title: binascii doesn't work with bytearray and memoryview types
Type: crash Severity: normal
Components: Core, Library Versions: Jython 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: amak, fwierzbicki, irmen, jeff.allen, mkz, santa4nt
Priority: Keywords:

Created on 2013-01-20.14:33:49 by irmen, last changed 2013-11-01.23:59:11 by santa4nt.

Messages
msg7584 (view) Author: Irmen de Jong (irmen) Date: 2013-01-20.14:33:46
binascii doesn't work with bytearray and memoryview types:

>>> import binascii
>>>
>>> binascii.b2a_base64(bytearray(b"hello"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: b2a_base64(): 1st arg can't be coerced to String
>>>
>>> binascii.b2a_base64(memoryview(b"hello"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: b2a_base64(): 1st arg can't be coerced to String
>>>


The above does work correctly in cPython 2.7
msg8136 (view) Author: Jeff Allen (jeff.allen) Date: 2013-09-29.21:44:36
Analysis: The binascii functions should be made to accept objects bearing the buffer interface: that would probably fix it. test_binascii currently stands disabled in regrtest.
History
Date User Action Args
2013-11-01 23:59:11santa4ntsetnosy: + santa4nt
2013-09-29 21:44:36jeff.allensetnosy: + jeff.allen
messages: + msg8136
2013-02-26 23:23:52amaksetnosy: + amak
2013-02-18 23:43:42fwierzbickisetnosy: + fwierzbicki
2013-02-18 23:43:27fwierzbickisetversions: + Jython 2.7, - 2.7a2
2013-02-15 08:47:55mkzsetnosy: + mkz
2013-01-20 14:33:50irmencreate