Issue1767742

classification
Title: array.array('xx') should throw TypeError, not ValueError
Type: Severity: normal
Components: Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: mboersma, pjenvey, ukeshav
Priority: normal Keywords:

Created on 2007-08-04.20:51:03 by mboersma, last changed 2008-07-23.20:24:20 by pjenvey.

Files
File name Uploaded Description Edit Remove
PyArray.diff mboersma, 2007-08-04.20:51:03 Fix for Jython TypeError bug
Messages
msg1801 (view) Author: Matt Boersma (mboersma) Date: 2007-08-04.20:51:03
test_array.py from CPython 2.3 includes a test case that expects array.array('xx') to throw a TypeError (the parameter should be a single char).  Jython 2.2rc3 throws a ValueError in this case instead.

Attached is a one-line patch that fixes this specific case.
msg1802 (view) Author: keshav upadhyaya (ukeshav) Date: 2007-09-10.13:29:59
Patch looks fine please commit it and close the bug..
msg3082 (view) Author: Philip Jenvey (pjenvey) Date: 2008-03-10.19:11:37
This should really throw a TypeError indicating the type of the param 
instead of hardcoding it to str. e.g.:

>>> array.array(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: array() argument 1 must be char, not None
msg3359 (view) Author: Philip Jenvey (pjenvey) Date: 2008-07-23.20:24:20
this is fixed on the asm branch
History
Date User Action Args
2008-07-23 20:24:20pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg3359
2008-03-10 19:11:38pjenveysetnosy: + pjenvey
messages: + msg3082
2007-08-04 20:51:03mboersmacreate