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: SystemError with re.match(array)
Type: Stage:
Components: Extension Modules Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: arigo Nosy List: arigo, nnorwitz, rhettinger
Priority: low Keywords:

Created on 2007-01-30 00:04 by arigo, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
empty-array.diff nnorwitz, 2007-01-30 05:21 v1
Messages (4)
msg31130 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2007-01-30 00:04
An small issue which I guess is to be found in
the implementation of the buffer interface
for zero-length arrays:

>>> a = array.array("c")
>>> r = re.compile("bla")
>>> r.match(a)
SystemError: error return without exception set
msg31131 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-01-30 05:21
Armin, what do you think of the attached patch?
File Added: empty-array.diff
msg31132 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2007-01-30 13:37
It seems to me that an empty array should be
equivalent to an empty string.  Accessing it as a
buffer should return a buffer of length 0, not
raise ValueError.

In all cases, the fix in _sre.c is sensible.
msg31133 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2007-04-02 22:54
Fixed in versions 54662 and 54663.
Now returns a buffer of length zero other than NULL.
History
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44520
2007-01-30 00:04:47arigocreate