[issue23489] atexit handlers are not executed when using multiprocessing.Pool.map.

juj report at bugs.python.org
Fri Feb 20 12:48:28 CET 2015


New submission from juj:

When Multiprocessing.Pool.map is used for a script that registers atexit handlers, the atexit handlers are not executed when the pool threads quit.

STR:

1. Run attached file in Python 2.7 with 'python task_spawn.py'
2. Observe the printed output.

Observed:

Console prints:

CREATED TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_qef8r_
CREATED TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_axi9tt
CREATED TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_vx6fmu
task1
task2
ATEXIT: REMOVING TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_qef8r_

Expected:

Console should print:

CREATED TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_qef8r_
CREATED TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_axi9tt
CREATED TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_vx6fmu
task1
task2
ATEXIT: REMOVING TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_vx6fmu
ATEXIT: REMOVING TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_axi9tt
ATEXIT: REMOVING TEMP DIRECTORY c:\users\clb\appdata\local\temp\temp_qef8r_

----------
components: Library (Lib)
files: task_spawn.py
messages: 236273
nosy: juj
priority: normal
severity: normal
status: open
title: atexit handlers are not executed when using multiprocessing.Pool.map.
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file38185/task_spawn.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23489>
_______________________________________


More information about the Python-bugs-list mailing list