Commit 09adb2b
Try to prevent a PermissionError on Windows
If `NamedTemporaryFile.__exit__` tries to delete the connect script
before the remote process has closed it, a `PermissionError` is raised
on Windows. Unfortunately there is no synchronization that we can use to
ensure that the file is closed before we try to delete it. This makes
the race less likely to occur by making the `with` block contain more
code, so that more time passes before we attempt to delete the file.
Co-authored-by: Chris Eibl <[email protected]>1 parent 5d59ce1 commit 09adb2b
1 file changed
+16
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3044 | 3044 | | |
3045 | 3045 | | |
3046 | 3046 | | |
3047 | | - | |
3048 | | - | |
| 3047 | + | |
| 3048 | + | |
3049 | 3049 | | |
3050 | 3050 | | |
3051 | 3051 | | |
3052 | | - | |
3053 | | - | |
| 3052 | + | |
| 3053 | + | |
3054 | 3054 | | |
3055 | 3055 | | |
3056 | 3056 | | |
3057 | 3057 | | |
3058 | | - | |
3059 | | - | |
| 3058 | + | |
| 3059 | + | |
3060 | 3060 | | |
3061 | | - | |
3062 | | - | |
3063 | | - | |
3064 | | - | |
3065 | | - | |
3066 | | - | |
3067 | | - | |
3068 | | - | |
3069 | | - | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
3070 | 3070 | | |
3071 | | - | |
| 3071 | + | |
3072 | 3072 | | |
3073 | 3073 | | |
3074 | 3074 | | |
| |||
0 commit comments