msg206503 - (view) |
Author: Vajrasky Kok (vajrasky) * |
Date: 2013-12-18 09:49 |
>>> import array >>> array.array(u'i', [1,2,3]) Traceback (most recent call last): File "", line 1, in TypeError: must be char, not unicode In this ticket #13566, Alexandre Vassalotti said: "We should still fix array in 2.7 to accept unicode object for the typecode though." So here is the patch to add support for ascii-unicode typecode for array.array constructor. |
|
|
msg206505 - (view) |
Author: Vajrasky Kok (vajrasky) * |
Date: 2013-12-18 10:13 |
Here is the patch with simpler unittest. |
|
|
msg206516 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-12-18 13:10 |
I think a patch can be much simpler. Perhaps make "c" to accept 1-character Unicode objects? |
|
|
msg206531 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-12-18 16:00 |
See for more general and simple solution. |
|
|
msg206571 - (view) |
Author: Vajrasky Kok (vajrasky) * |
Date: 2013-12-19 02:36 |
Thanks, Serhiy, for the review! Here is the patch to avoid refleaking and avoid literal u'' string. If your ticket, #20015, is accepted, then we can throw away the fix and use only unit test in this ticket. |
|
|
msg206720 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2013-12-21 00:12 |
This enhancement request would have been nice in 2.7.0 but it is too late for bugfix releases. Typecodes have always been shown as instances of str and still are. The doc no where suggests that unicode chars should work in 2.7 and it is not a bug that they do not. |
|
|
msg212613 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2014-03-03 07:31 |
Re-opened due to Python-Dev discussion http://comments.gmane.org/gmane.comp.python.devel/146057. |
|
|
msg243321 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-05-16 14:13 |
New changeset 7d60cb6c33cf by Serhiy Storchaka in branch '2.7': Issue #20014: array.array() now accepts unicode typecodes. Based on patch by https://hg.python.org/cpython/rev/7d60cb6c33cf |
|
|
msg243465 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2015-05-18 08:31 |
Committed simplified version. Thank you Vajrasky for your patch. |
|
|
msg244528 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-05-31 08:57 |
New changeset 6ee122fac1e8 by Serhiy Storchaka in branch '2.7': Fixed the array module in unicode disabled build (regression of ). https://hg.python.org/cpython/rev/6ee122fac1e8 |
|
|