◐ Shell
reader mode source ↗
Skip to content

bpo-30028: make test.support.temp_cwd() fork-safe#1066

Merged
gpshead merged 8 commits into
python:masterfrom
akruis:tempcwd_fork_fix
Feb 23, 2018
Merged

bpo-30028: make test.support.temp_cwd() fork-safe#1066
gpshead merged 8 commits into
python:masterfrom
akruis:tempcwd_fork_fix

Conversation

@akruis

@akruis akruis commented Apr 9, 2017

Copy link
Copy Markdown

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

https://bugs.python.org/issue30028

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

Copy link
Copy Markdown

@akruis, thanks for your PR! By analyzing the history of the files in this pull request, we identified @serhiy-storchaka, @Yhg1s and @ncoghlan to be potential reviewers.

Remove an unused "import sys".
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.
An assert might removed depending on Python options.
@akruis

akruis commented Apr 17, 2017

Copy link
Copy Markdown
Author

@Haypo and @serhiy-storchaka: Any chance to get this PR merged?

- 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
This commit merges the fix from C-Python pull request
python#1066 (git commit 22e032a) for
bpo-30028. Without this change
   $ ./python -m test.regrtest test_multiprocessing_fork
fails. ($ ./python -m test.test_multiprocessing_fork is OK.)

https://bitbucket.org/stackless-dev/stackless/issues/112
akruis pushed a commit to akruis/cpython that referenced this pull request Sep 9, 2017
This commit merges the fix from C-Python pull request
python#1066 (git commit 22e032a) for
bpo-30028. Without this change
   $ ./python -m test.regrtest test_multiprocessing_fork
fails. ($ ./python -m test.test_multiprocessing_fork is OK.)

https://bitbucket.org/stackless-dev/stackless/issues/112
(grafted from bda8a9d487da7cfbe4357d5c4c7635e0de19c6af)
@gpshead gpshead self-assigned this Jan 30, 2018
@brettcannon

Copy link
Copy Markdown
Member

To try and help move older pull requests forward, we are going through and backfilling 'awaiting' labels on pull requests that are lacking the label. Based on the current reviews, the best we can tell in an automated fashion is that a core developer requested changes to be made to this pull request.

If/when the requested changes have been made, please leave a comment that says, I have made the requested changes; please review again. That will trigger a bot to flag this pull request as ready for a follow-up review.

@serhiy-storchaka

Copy link
Copy Markdown
Member

I think requests by @vstinner were satisfied.

14 hidden items Load more…
@serhiy-storchaka

Copy link
Copy Markdown
Member

A news entry is not required since this function is for internal use, but it would be worth to add your name @akruis into Misc/ACKS.

Proposed by Serhiy Storchaka.
@akruis

akruis commented Feb 22, 2018

Copy link
Copy Markdown
Author

Is there anything, I can do to get this PR merged?

@gpshead gpshead merged commit 33dddac into python:master Feb 23, 2018
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @akruis for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7.
🐍🍒⛏🤖

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>
@bedevere-bot

Copy link
Copy Markdown

GH-5824 is a backport of this pull request to the 3.7 branch.

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @akruis and @gpshead, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 33dddac00ba8d9b72cf21b8698504077eb3c23ad 2.7

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @akruis and @gpshead, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 33dddac00ba8d9b72cf21b8698504077eb3c23ad 3.6

@gpshead

gpshead commented Feb 23, 2018

Copy link
Copy Markdown
Member

I'm not sure it is actually worth backporting this to 3.6 or 2.7 for this internal test support library issue but if you want to do so, just create PRs using cherry_picker and tag me on them for review/merge. :)

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>
@bedevere-bot

Copy link
Copy Markdown

GH-5825 is a backport of this pull request to the 2.7 branch.

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>
@bedevere-bot

Copy link
Copy Markdown

GH-5826 is a backport of this pull request to the 3.6 branch.

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants