[Python-bugs-list] [ python-Bugs-523859 ] unexpected endless loop

noreply@sourceforge.net noreply@sourceforge.net
Thu, 28 Feb 2002 08:15:13 -0800


Bugs item #523859, was opened at 2002-02-28 15:45
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=523859&group_id=5470

Category: Parser/Compiler
Group: Python 2.1.1
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Anatoly Artamonov (arthem)
Assigned to: Nobody/Anonymous (nobody)
Summary: unexpected endless loop

Initial Comment:
This is the simplified example of code that causes 
endless loop.
Save it in file (i.e. bad.py) and run "python bad.py"

Tested on 2 pc with FreeBDS and Python 2.1.1
on Win32 with py 1.5.2 compiler says:
SyntaxError: 'continue' not properly in loop (line 7)

##################################################
k = 0
print "Start"
while 1:
    k=k+1
    if k>2: break
    try: 
        if k>1: continue
    except: pass
########################EOF#######################


removing of try/except
makes execution normal.
Though in example usage of try/except is unnecessary -
this was taken from live application where it was 
necessary.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-02-28 17:15

Message:
Logged In: YES 
user_id=21627

That could well be, which would explain why I cannot
reproduce it. Closing as fixed. 

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-02-28 16:40

Message:
Logged In: YES 
user_id=6656

Isn't this the problem that was fixed in version 2.277 of
ceval.c?

IOW, get 2.1.2 or 2.2.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-02-28 16:30

Message:
Logged In: YES 
user_id=21627

I cannot reproduce this problem. Can anybody else? For
easier extraction from the report, I attach the script in
question as a.py.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=523859&group_id=5470