[issue13139] multiprocessing.map skips finally blocks

2020-10-23 Thread Irit Katriel
Change by Irit Katriel : -- stage: -> needs patch versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 3.3 ___ Python tracker ___ __

[issue13139] multiprocessing.map skips finally blocks

2011-10-15 Thread Jesse Noller
Jesse Noller added the comment: Antoine is correct, as he usually is. This is more of a documentation issue than bug. -- ___ Python tracker ___

[issue13139] multiprocessing.map skips finally blocks

2011-10-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: As mentioned in http://docs.python.org/dev/library/multiprocessing#multiprocessing.pool.AsyncResult.get “If the remote call raised an exception then that exception will be reraised by get().” map() is just map_async() followed by a get() call on the result. A

[issue13139] multiprocessing.map skips finally blocks

2011-10-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: One might ask why an Exception in one process kills all in the Pool. Perhaps multiprocessing emulates threading too closely. Perhaps it is assumed that if one is bad, all are. Jesse? -- nosy: +jnoller, terry.reedy versions: -Python 2.6 __

[issue13139] multiprocessing.map skips finally blocks

2011-10-09 Thread Daniel Wagner-Hall
Daniel Wagner-Hall added the comment: Explanation of behaviour at http://stackoverflow.com/questions/7700929/python-multiprocessing-map-if-one-thread-raises-an-exception-why-arent-other tl;dr SIGTERM kills subprocesses and finally blocks aren't called. I still consider this a bug, though ---

[issue13139] multiprocessing.map skips finally blocks

2011-10-09 Thread Florent Xicluna
Florent Xicluna added the comment: Same behavior on Python 3.2 with this code: from multiprocessing import Pool from time import sleep def Process(x): try: print(x) sleep(.6-x/10.) raise Exception('Exception: %d' % x) finally: print('Finally: %d' % x)

[issue13139] multiprocessing.map skips finally blocks

2011-10-08 Thread Daniel Wagner-Hall
New submission from Daniel Wagner-Hall : import random from multiprocessing import Pool from time import sleep def Process(x): try: print x sleep(random.random()) raise Exception('Exception: ' + x) finally: print 'Finally: ' + x Pool(3).map(Process, ['1','2','3']) Expect a