[issue29518] 'for' loop not automatically breaking (index error on line of loop header)

Justin McNiel report at bugs.python.org
Thu Feb 9 21:47:38 EST 2017


New submission from Justin McNiel:

All for loops are refusing to break (Python 2.7.13) on win32
      - only on execution of '.py' file
an example would be:"
for x in range(5): #Line 1 of main.py
    print x        #Line 2 of main.py
"
and the resulting error would be:"
    File "pathToFile\main.py", line 1, in <module>
        for x in range(5):
IndexError: array index out of range
"
I also have 32-bit python 3.6 installed, but the default for opening '.py' files is python 2.7
This error happens on custom made generators too, but never in the interactive shell.

----------
components: Windows
files: pythonError.png
messages: 287473
nosy: Justin McNiel, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: 'for' loop not automatically breaking (index error on line of loop header)
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file46616/pythonError.png

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29518>
_______________________________________


More information about the Python-bugs-list mailing list