This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davin
Recipients davin, elias, lev-veshnyakov
Date 2016-11-16.14:54:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479308070.78.0.651580630815.issue28699@psf.upfronthosting.co.za>
In-reply-to
Content
To tie in the example given by @elias in issue28625, this inconsistency in behavior is not limited to ThreadPool -- it appears with a process Pool as well:


from multiprocessing import Pool


def double(x):
    return 2 * x

def get_numbers():
    raise Exception("oops")
    yield 1
    yield 2


>>> list(Pool(processes=2).imap(double, get_numbers()))  # returns list
[]
>>> list(Pool(processes=2).map(double, get_numbers()))
Traceback (most recent call last):
  ...
Exception: oops


def get_numbers_differently():
    yield 1
    raise Exception("oops")
    yield 2


>>> list(Pool(processes=2).imap(double, get_numbers_differently()))  # now we see exception
Traceback (most recent call last):
  ...
Exception: oops
History
Date User Action Args
2016-11-16 14:54:30davinsetrecipients: + davin, elias, lev-veshnyakov
2016-11-16 14:54:30davinsetmessageid: <1479308070.78.0.651580630815.issue28699@psf.upfronthosting.co.za>
2016-11-16 14:54:30davinlinkissue28699 messages
2016-11-16 14:54:30davincreate