Issue1679

classification
Title: iteration broken with TypeError: 'instance' object is not iterable
Type: Severity: minor
Components: Versions: 2.5.1
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: ron, zyasoft
Priority: Keywords:

Created on 2010-11-23.23:35:13 by ron, last changed 2010-11-24.19:55:47 by ron.

Messages
msg6260 (view) Author: Robin Palotai (ron) Date: 2010-11-23.23:35:12
Problem:
Unfortunately I can't reproduce it outside a complex application. Basically, iterating on a set (or list obtained from that set with list(the_set)) breaks after a random number of elements retrieved (random = 0..) with TypeError: 'instance' object is not iterable.

With debug printing added, this happens in the middle of the iteration (for example, after element 5 in a 11-element list).

If I manually retrieve the_list.__iter__() and repeatedly call next() on it, I can iterate over the elements fine (until a StopIteration exception as expected at the end).

Does this ring any bell? Or could you give me pointers how to deep-debug it? I fear a simple test-case can't be easily created from current code.

Platform: Linux/Debian x86, JDK 1.6.0, both update 20 and 22 (standard binary install), jython 2.5.1 from netbeans package manager (also tested with 2.5.2rc2:7176.)
msg6261 (view) Author: Robin Palotai (ron) Date: 2010-11-24.10:40:00
Resolved, error was in application code. Please close this.
msg6262 (view) Author: Jim Baker (zyasoft) Date: 2010-11-24.17:46:32
Robin, was the error because of a data race of some kind? That's what it seemed to me when I saw the bug email. Good to hear it's not in our code!
msg6263 (view) Author: Robin Palotai (ron) Date: 2010-11-24.19:55:47
Jim, it was a pretty trivial error I'm ashamed to tell - the set was supposed to hold pairs, and somehow a 1-tuple sneaked in, so the error really referred to the unpacking of the tuple two two elements.

Why I initially thought it was the set, that the elements I inserted were the same, but the iteration broke after different number of processed elements - but supposedly that is because the non-deterministic ordering of the set.

However the main reason could have been that it was late ;) Sorry again.
History
Date User Action Args
2010-11-24 19:55:47ronsetmessages: + msg6263
2010-11-24 17:46:32zyasoftsetstatus: open -> closed
resolution: invalid
messages: + msg6262
nosy: + zyasoft
2010-11-24 10:40:00ronsetmessages: + msg6261
severity: normal -> minor
2010-11-23 23:35:13roncreate