[New-bugs-announce] [issue40310] If use element from for in while loop it will have bad iterate.

Maks Bleo report at bugs.python.org
Fri Apr 17 06:17:23 EDT 2020


New submission from Maks Bleo <bleomaks at gmail.com>:

Windows 10
Version 1909 (OS Build18363.778)
Python 3.7.7 x64

cars_av_by_spider_scr.py - py file for scrapy.
bash command to use
scrapy runspider cars_av_by_spider_scr.py -o cars_av_by_spider_scr.json > cars_av_by_spider_scr.txt 2>&1

Bad behavior in line 52. (In comment fixed version)

When while loop iterate on second step instead of using
model[0], model[1] it start use model[1][0] and model[1][1].
On third step it  crash, out of range.

But if assign value before while loop and use it in while loop everything work fine. 


It's my first bug report.

----------
components: Interpreter Core
files: cars_av_by_spider_scr.py
messages: 366652
nosy: Maks Bleo
priority: normal
severity: normal
status: open
title: If use element from for in while loop it will have bad iterate.
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file49071/cars_av_by_spider_scr.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40310>
_______________________________________


More information about the New-bugs-announce mailing list