Message291396
The context manager test.support.temp_cwd() creates a temporary directory and removes it on exit. The test runner test.regrtest uses this context manager.
I observed an annoying behaviour of test.support.temp_cwd() on Linux/UNIX: if the code, that runs in the temp_cwd() context forks and if the forked child terminates (without calling exec), then the temporary directory will be removed twice: by the child and by the parent. This can cause errors in the parent, if the parent tries to access the no longer existing directory.
I discovered this problem, when a test in test_multiprocessing_fork failed and the test directory for the complete test.regrtest-run got removed. Of course all other tests failed too.
I propose to modify test.support.temp_cwd() to remove the created directory only, if the process id (os.getpid()) is unchanged. I'll create a pull request. |
|
Date |
User |
Action |
Args |
2017-04-09 20:00:25 | anselm.kruis | set | recipients:
+ anselm.kruis |
2017-04-09 20:00:25 | anselm.kruis | set | messageid: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> |
2017-04-09 20:00:25 | anselm.kruis | link | issue30028 messages |
2017-04-09 20:00:24 | anselm.kruis | create | |
|