File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def marker_environment(python: str) -> dict[str, str]:
101101 fingerprint = _fingerprint (python .encode ())
102102 markers_file = _ensure_cache_dir () / "interpreters" / f"markers.{ fingerprint } .json"
103103 if not os .path .exists (markers_file ):
104- with FileLock (markers_file ), TemporaryDirectory (
104+ with FileLock (f" { markers_file } .lck" ), TemporaryDirectory (
105105 dir = markers_file .parent , prefix = "packaging-venv."
106106 ) as td :
107107 print (
@@ -114,7 +114,8 @@ def marker_environment(python: str) -> dict[str, str]:
114114 stdout = sys .stderr .fileno (),
115115 check = True ,
116116 )
117- markers_file .write_bytes (
117+ temp_markers_file = Path (td ) / markers_file .name
118+ temp_markers_file .write_bytes (
118119 subprocess .run (
119120 args = [
120121 venv_layout .python ,
@@ -134,6 +135,7 @@ def marker_environment(python: str) -> dict[str, str]:
134135 check = True ,
135136 ).stdout
136137 )
138+ temp_markers_file .rename (markers_file )
137139 return cast (Dict [str , str ], json .loads (markers_file .read_bytes ()))
138140
139141
You can’t perform that action at this time.
0 commit comments