Skip to content

Commit c2a8b6c

Browse files
committed
fix: use the default http client when downloading python versions
Close #2759 Signed-off-by: Frost Ming <[email protected]>
1 parent 4d09651 commit c2a8b6c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

news/2759.bugfix.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use the default HTTP client when downloading the pythons, to use the certificates settings.

src/pdm/cli/commands/python.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ def install_python(project: Project, request: str) -> PythonInfo:
121121
destination.mkdir(parents=True, exist_ok=True)
122122
with tempfile.NamedTemporaryFile() as tf:
123123
tf.close()
124-
original_filename = download(python_file, tf.name)
124+
original_filename = download(python_file, tf.name, project.environment.session)
125125
spinner.update(f"Installing [success]{ver}[/]")
126-
install_file(tf.name, destination, original_filename, build_dir=False)
126+
install_file(tf.name, destination, original_filename)
127127

128128
interpreter = destination / "bin" / "python3" if sys.platform != "win32" else destination / "python.exe"
129129
if not interpreter.exists():

0 commit comments

Comments
 (0)