Skip to content

Commit

Permalink
fix: use the default http client when downloading python versions
Browse files Browse the repository at this point in the history
Close #2759

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Apr 2, 2024
1 parent 4d09651 commit c2a8b6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/2759.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the default HTTP client when downloading the pythons, to use the certificates settings.
4 changes: 2 additions & 2 deletions src/pdm/cli/commands/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ def install_python(project: Project, request: str) -> PythonInfo:
destination.mkdir(parents=True, exist_ok=True)
with tempfile.NamedTemporaryFile() as tf:
tf.close()
original_filename = download(python_file, tf.name)
original_filename = download(python_file, tf.name, project.environment.session)
spinner.update(f"Installing [success]{ver}[/]")
install_file(tf.name, destination, original_filename, build_dir=False)
install_file(tf.name, destination, original_filename)

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

0 comments on commit c2a8b6c

Please sign in to comment.