bpo-29694: race condition in pathlib mkdir with flags parents=True - #1089
Conversation
| 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. |
…rue (pythonGH-1089). (cherry picked from commit 22a594a)
…rue (pythonGH-1089). (cherry picked from commit 22a594a)

No description provided.