Author tim.peters
Recipients
Date 2002-07-13.19:32:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
From c.l.py:

"""
From: Jane Austine
Sent: Saturday, July 13, 2002 6:01 AM
To: python-list@python.org
Subject: sre.finditer break down: is this a bug?

Newly added function sre.finditer and 
(matchedObject.)finditer break down and the system 
crushes on win32 when requested for next() after 
StopIteration.

see:
>> import sre
>> fi=sre.finditer(r'\s','a b')
>> fi.next()
>> fi.next()
>> fi.next() #system halts for ever.
-- 
"""

The semantics of the underlying calliterobject aren't 
clear to me in this endcase, and I've raised that issue 
on c.l.py.

But regardless of how that's resolved,  it's easy to 
provoke the bad behavior without using finditer, and 
that should be fixed:

>>> import re
>>> s = re.compile(r'\s').scanner
>>> t = s('a b').search
>>> t()
<_sre.SRE_Match object at 0x00679F70>
>>> t()
>>> t()
>>> t()

and there it's hung.
History
Date User Action Args
2007-08-23 14:04:08adminlinkissue581080 messages
2007-08-23 14:04:08admincreate