[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-15 Thread Lev Veshnyakov
Changes by Lev Veshnyakov : -- nosy: +davin ___ Python tracker <http://bugs.python.org/issue28699> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-15 Thread Lev Veshnyakov
New submission from Lev Veshnyakov: Consider the following code: from multiprocessing.pool import ThreadPool pool = ThreadPool(10) def gen(): yield 1 + '1' # here is an error print(list(pool.imap(str, gen( # prints [] print(list(pool.map(str, gen( # raises Type

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-15 Thread Lev Veshnyakov
Lev Veshnyakov added the comment: Yes, I'm free to move to 3.5, now I'm seeing isn't there any problems in 3.5 according to this issue. -- ___ Python tracker <http://bugs.pyt

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-15 Thread Lev Veshnyakov
Lev Veshnyakov added the comment: It's hanging in a while loop in _handle_workers, /usr/lib/python3.4/multiprocessingpool.py:365. I can't figure out what is the reason. @staticmethod def _handle_workers(pool): thread = threading.current_thread() # Keep maintaining workers

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-15 Thread Lev Veshnyakov
Lev Veshnyakov added the comment: I've reproduced it on 2 different machines: - on a MacBook in Docker (debian:jessie, python 3.4.2) - on another desktop (Ubuntu 14.04.1, 3.16.0-77-generic, x86_64, python 3.4.3) -- ___ Python tracker

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-15 Thread Lev Veshnyakov
Lev Veshnyakov added the comment: So, I've checked twice, it's presented by me on python 3.4.3, and not by 3.5.2. So I will go deaper -- ___ Python tracker <http://bugs.python.o

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-15 Thread Lev Veshnyakov
Lev Veshnyakov added the comment: Ubuntu 14.04 LTS, 3.13.0-83-generic, x86_64 -- ___ Python tracker <http://bugs.python.org/issue28696> ___ ___ Python-bugs-list m

[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-15 Thread Lev Veshnyakov
New submission from Lev Veshnyakov: It's only in imap, in map it's ok. The following code explains the issue: from multiprocessing.pool import ThreadPool pool = ThreadPool(10) def gen(): yield 1 + '1' # here is an error try: next((pool.imap(str, gen( e