Skip to content

Commit

Permalink
fix: append pip errors to log file rather than overwrite
Browse files Browse the repository at this point in the history
Resolves pypa#1132 

An alternative would be to create new log files for each pip invocation, but this would require deeper changes. Appending seems like a decent solution as a first fix.
  • Loading branch information
corneliusroemer authored Dec 3, 2023
1 parent b97b647 commit 29c4f60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pipx/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def subprocess_post_check_handle_pip_error(
if pipx.constants.pipx_log_file is None:
raise PipxError("Pipx internal error: No log_file present.")
pip_error_file = pipx.constants.pipx_log_file.parent / (pipx.constants.pipx_log_file.stem + "_pip_errors.log")
with pip_error_file.open("w", encoding="utf-8") as pip_error_fh:
with pip_error_file.open("a", encoding="utf-8") as pip_error_fh:
print("PIP STDOUT", file=pip_error_fh)
print("----------", file=pip_error_fh)
if completed_process.stdout is not None:
Expand Down

0 comments on commit 29c4f60

Please sign in to comment.