Skip to content

Commit 7881c15

Browse files
committed
thanks windows...
1 parent de3a0e8 commit 7881c15

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rsconnect/subprocesses/inspect_environment.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ def uv_export(dirname: str, lock_filename: str):
200200
if not os.path.exists(lock_path):
201201
raise EnvironmentException("uv.lock not found: %s" % lock_filename)
202202

203-
with tempfile.NamedTemporaryFile(mode="w+", encoding="utf-8") as tmp_file:
203+
with tempfile.TemporaryDirectory() as tmpdir:
204+
output_path = os.path.join(tmpdir, "requirements.txt.lock")
204205
try:
205206
result = subprocess.run(
206207
[
@@ -215,7 +216,7 @@ def uv_export(dirname: str, lock_filename: str):
215216
"--no-header",
216217
"--no-emit-project",
217218
"--output-file",
218-
tmp_file.name,
219+
output_path,
219220
],
220221
cwd=os.path.dirname(lock_path),
221222
stdout=sys.stderr,
@@ -228,7 +229,7 @@ def uv_export(dirname: str, lock_filename: str):
228229
if result.returncode != 0:
229230
raise EnvironmentException("Error during uv export: exited with code %d" % result.returncode)
230231

231-
with open(tmp_file.name) as output_file:
232+
with open(output_path) as output_file:
232233
exported = output_file.read()
233234

234235
requirements = filter_pip_freeze_output(exported)

0 commit comments

Comments
 (0)