bpo-29694: race condition in pathlib mkdir with flags parents=True#1089
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
| got_exception = False | ||
| except FileExistsError: | ||
| got_exception = True | ||
| self.assertEqual(str(p12) in concurrently_created, got_exception) |
There was a problem hiding this comment.
assertIn()/assertNotIn()? This will give more information in the case of failure.
try:
...
except FileExistsError:
self.assertIn(str(p12), concurrently_created)
else:
self.assertNotIn(str(p12), concurrently_created)
| os.mkdir(path, mode) # from another process | ||
| concurrently_created.add(path) | ||
| os.mkdir(path, mode) # our real call | ||
| org_mkdir = pathlib._normal_accessor.mkdir |
There was a problem hiding this comment.
Seems this is not used.
| Library | ||
| ------- | ||
|
|
||
| - bpo-29694: race condition in pathlib mkdir with flags parents=True |
There was a problem hiding this comment.
Add "Fixed" at the start, add a period at the end.
|
In general LGTM, just few minor comments. |
| # just before we try to create it ourselves. We do it | ||
| # in all possible pattern combinations, assuming that this | ||
| # function is called at most 5 times (dirCPC/dir1/dir2, | ||
| # dirCPC/dir1, dirCPC, dirCPC/dir1, cirCPC/dir1/dir2). |
There was a problem hiding this comment.
cirCPC looks like a typo here.
| ------- | ||
|
|
||
| - bpo-29694: Fixed race condition in pathlib mkdir with flags | ||
| parents=True. |
There was a problem hiding this comment.
You can also add "Patch by Armin Rigo.".
There was a problem hiding this comment.
Since Armin is a core developer and will merge the PR himself this is not necessary.
|
I may be a core developer but nowadays I'd call this "historical reasons". I didn't commit anything for ages. Please merge this for me. |
|
I updated Misc/NEWS. I will merge and backport once travis CI is completed. |
…rue (pythonGH-1089). (cherry picked from commit 22a594a)
…rue (pythonGH-1089). (cherry picked from commit 22a594a)
No description provided.