Commit 579b683
* #272 fix race condition to make folders in directory store
* #272 remove FileNotFoundError for python 2 support
* Change OSError to KeyError to make tests pass
* Only catch `OSError` if its `errno` equal `EEXIST`
On Python 3, we would only want to catch the race case here by checking
for the `FileExistsError` and suppressing raising for that case. However
there is no `FileExistsError` on Python 2. Only `OSError` exists on
Python 2/3. However that catches some other errors that we might not
want to suppress here. So we check the `errno` of the `OSError` instance
to verify it is caused by an existing file/directory represented by the
`EEXIST` error number. This amounts to catching the `FileExistsError` in
a Python 2/3 friendly way. All other `OSErrors` we raise as before.
* Drop generic `Exception` case in `DirectoryStore`
As we now properly handle the existing file case properly, go ahead and
drop the generic exception case. This should now raise some errors that
were hidden previously.
1 parent f582737 commit 579b683
3 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
745 | 746 | | |
746 | 747 | | |
747 | 748 | | |
748 | | - | |
749 | | - | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
750 | 752 | | |
751 | 753 | | |
752 | 754 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments