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 elias
Recipients elias
Date 2016-11-06.16:16:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478449003.58.0.0873174644967.issue28625@psf.upfronthosting.co.za>
In-reply-to
Content
I have the following code:

from multiprocessing import Pool

def double(x):
    return 2 * x

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

print(list(Pool(processes=2).imap(double, get_numbers())))


I would expect it to raise an exception, but instead it just prints "[]", seeming to indicate that imap ran fine and produced no values.

This seems similar to the behavior described in bugs 23051 and 26333, but this happens if the iterator directly raises an exception before yielding anything. If I move the raise statement below one or both of the yields, I get an exception from imap as expected.

I am experiencing this with Python 3.5.2 on OS X 10.11.6. I haven't tried it with any other versions.
History
Date User Action Args
2016-11-06 16:16:43eliassetrecipients: + elias
2016-11-06 16:16:43eliassetmessageid: <1478449003.58.0.0873174644967.issue28625@psf.upfronthosting.co.za>
2016-11-06 16:16:43eliaslinkissue28625 messages
2016-11-06 16:16:43eliascreate