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())))
except:
    # Will be catched using pool.map normally, but using pool.imap will be not.
    # Instead it hangs. This is the same for ThreadPool and Pool.
    print('this will not be printed because thread is hanging')

----------
components: Library (Lib)
files: test.py
messages: 280833
nosy: lev-veshnyakov
priority: normal
severity: normal
status: open
title: imap from ThreadPool hangs by an exception in a generator function
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file45486/test.py

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

Reply via email to