This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: array unittest problems with UCS4 build
Type: Stage:
Components: Extension Modules Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, gvanrossum, teoliphant
Priority: normal Keywords: patch

Created on 2007-10-12 03:10 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k_array_typecode.patch christian.heimes, 2007-10-12 03:10
Messages (7)
msg56353 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-10-12 03:10
The array module is using a different typecode for unicode array
depending on UCS2 or UCS4:

#define Py_UNICODE_SIZE 4

#if Py_UNICODE_SIZE >= 4
#define Py_UNICODE_WIDE
#endif

#ifdef Py_UNICODE_WIDE
#define PyArr_UNI 'w'
#define PyArr_UNISTR "w"
#else
#define PyArr_UNI 'u'
#define PyArr_UNISTR "u"
#endif

It's causing a bunch of unit test to fail which depend on 'u' as the
type code for an unicode array. I don't see the benefit from specifying
an alternative typecode for wide unicode arrays. It may be useful to
have an additional typecode that fails for UCS-2 builds.

My patch keeps 'u' in every build and adds 'w' as an alias for 'u' in
UCS-4 builds only. It also introduces the new module variable typecodes
which is a unicode string containing all valid typecodes.
msg56375 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-10-12 15:43
svn annotate shows that you implemented the 'w' typecode in revision
57181. What do you think about my patch and my proposal?
msg56399 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-10-14 01:04
Can this be closed now that Travis reverted his patch?
msg56407 - (view) Author: Travis Oliphant (teoliphant) * (Python committer) Date: 2007-10-14 03:56
This issue may be closed.
msg56416 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-10-14 15:26
> Can this be closed now that Travis reverted his patch?

Yes, it can be closed.

By the way svn.python.org and the anon svn server are down the third
time this week. Something is wrong with the server.

Christian
msg56421 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-10-14 16:59
Oh stop, the array module doesn't build for me (Ubuntu Linux, i386,
UCS-4 build, rev58458):

Modules/arraymodule.c: In function 'array_buffer_getbuf':
Modules/arraymodule.c:1815: error: 'Py_buffer' has no member named 'formats'

Please replace formats with format in line 1815:

    view->format = "w";

Christian
msg56424 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-10-14 20:46
> Oh stop, the array module doesn't build for me (Ubuntu Linux, i386,
> UCS-4 build, rev58458):
>
> Modules/arraymodule.c: In function 'array_buffer_getbuf':
> Modules/arraymodule.c:1815: error: 'Py_buffer' has no member named 'formats'
>
> Please replace formats with format in line 1815:
>
>     view->format = "w";

Done.
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45609
2007-10-14 20:46:51gvanrossumsetmessages: + msg56424
2007-10-14 16:59:23christian.heimessetmessages: + msg56421
2007-10-14 15:26:16christian.heimessetmessages: + msg56416
2007-10-14 04:17:43gvanrossumsetstatus: open -> closed
resolution: fixed
2007-10-14 03:56:18teoliphantsetmessages: + msg56407
2007-10-14 01:04:13gvanrossumsetnosy: + gvanrossum
messages: + msg56399
2007-10-12 15:43:59christian.heimessetnosy: + teoliphant
messages: + msg56375
2007-10-12 07:06:27loewissetkeywords: + patch
2007-10-12 03:10:48christian.heimescreate