sre.finditer break down: is this a bug?

Tim Peters tim.one at comcast.net
Sat Jul 13 15:38:28 EDT 2002


[Jane Austine]
> 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.

[Fredrik Lundh]
> well, I'm tempted to just say "don't do that" (if python tells
> you to stop iterating, stop iterating ;-), but it sure looks like
> a bug.
>
> bugs are best reported on sourceforge; see
>
>     http://www.python.org/dev/
>
> for details and links.

I entered a bug report for this:

    http://www.python.org/sf/581080

I think re has "an issue" here independent of the intended semantics of the
iteration protocol when calling next() after StopIteration has been raised,
and the bug report shows a derived example with the same symptom but not
using finditer.

I brought up the business about the intended iteration protocol semantics on
Python-Dev.






More information about the Python-list mailing list