Davin Potts added the comment:

@xiang.zhang:  Nice catch -- thank you for pointing out the additional issue 
that arises when trying to provoke the issue twice in a row.

The module attribute `job_counter` helped, in this situation, point out what 
might have otherwise been overlooked.

I didn't like any of my previously suggested approaches, but I think there's a 
4th option:
4.  Guard against misbehaving generators/iterables *before* they are put into 
the taskqueue.


Now when we provide a problematic generator/iterable to imap, the exception it 
triggers is caught and the resulting exception passed through the system to 
make use of the logic that is already in place.

This same issue can arise for imap_unordered() as well as imap() and can be 
addressed in the same manner.


Attaching another preliminary patch that still lacks formal tests but I'll 
attach crude versions of tests momentarily.

If we're still missing some use case or other logic path, now's the time to 
find it.

----------
Added file: 
http://bugs.python.org/file45645/issue_28699_guards_iterable_still_lacks_formal_test_py3x.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28699>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to