◐ Shell
clean mode source ↗

bpo-30028: make test.support.temp_cwd() fork-safe by akruis · Pull Request #1066 · python/cpython

Improve the context manager test.support.temp_cwd() to not remove the temporary
directory, if a forked child terminates.

serhiy-storchaka

Remove an unused "import sys".

vstinner

vstinner

Added an explanatory comment and moved the test to test_support.py.
I also modified the test to be in line with the other tests of temp_cwd.

vstinner

serhiy-storchaka

vstinner

An assert might removed depending on Python options.

vstinner

vstinner

- better comments
- make sure, that the child exits successfully

akruis pushed a commit to stackless-dev/stackless that referenced this pull request

Sep 5, 2017

akruis pushed a commit to akruis/cpython that referenced this pull request

Sep 9, 2017

@serhiy-storchaka

Proposed by Serhiy Storchaka.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Feb 23, 2018
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup.
(cherry picked from commit 33dddac)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>

miss-islington added a commit that referenced this pull request

Feb 23, 2018
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup.
(cherry picked from commit 33dddac)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>

akruis pushed a commit to akruis/cpython that referenced this pull request

Feb 23, 2018
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>

akruis pushed a commit to akruis/cpython that referenced this pull request

Feb 23, 2018
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>

@akruis akruis deleted the tempcwd_fork_fix branch

February 23, 2018 11:45

gpshead pushed a commit that referenced this pull request

Feb 23, 2018
…-5825)

Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>

gpshead pushed a commit that referenced this pull request

Feb 23, 2018
…-5826)

Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>