Issue 20014: Makes array.array constructor accepts ascii-unicode typecode (original) (raw)

Created on 2013-12-18 09:49 by vajrasky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
makes_array_accepts_ascii_unicode_typecode.patch vajrasky,2013-12-18 09:49 review
makes_array_accepts_ascii_unicode_typecode_v2.patch vajrasky,2013-12-18 10:16 review
makes_array_accepts_ascii_unicode_typecode_v3.patch vajrasky,2013-12-19 02:36 review
Messages (10)
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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) (Python triager) 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) * (Python committer) Date: 2015-05-18 08:31
Committed simplified version. Thank you Vajrasky for your patch.
msg244528 - (view) Author: Roundup Robot (python-dev) (Python triager) 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
History
Date User Action Args
2022-04-11 14:57:55 admin set github: 64213
2015-05-31 08:57:31 python-dev set messages: +
2015-05-18 08:31:38 serhiy.storchaka set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2015-05-16 14:13:25 python-dev set nosy: + python-devmessages: +
2015-05-11 07:54:17 serhiy.storchaka set assignee: serhiy.storchaka
2014-03-03 07:32:00 serhiy.storchaka set status: closed -> openresolution: out of date -> (no value)messages: + stage: resolved -> patch review
2013-12-21 00:12:18 terry.reedy set status: open -> closedtype: behavior -> enhancementnosy: + terry.reedymessages: + resolution: out of datestage: patch review -> resolved
2013-12-20 23:39:23 terry.reedy set stage: patch review
2013-12-19 02:36:37 vajrasky set files: + makes_array_accepts_ascii_unicode_typecode_v3.patchmessages: +
2013-12-18 16:00:59 serhiy.storchaka set messages: +
2013-12-18 13:10:28 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2013-12-18 10:16:19 vajrasky set files: + makes_array_accepts_ascii_unicode_typecode_v2.patch
2013-12-18 10:16:07 vajrasky set files: - makes_array_accepts_ascii_unicode_typecode_v2.patch
2013-12-18 10:13:11 vajrasky set files: + makes_array_accepts_ascii_unicode_typecode_v2.patchmessages: +
2013-12-18 09:49:55 vajrasky create