-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error logs overwrite each other when using reinstall-all
#1132
Comments
The bug seems to be here, where Line 327 in b97b647
|
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.
Hi @gaborbernat and @chrysle, I am interested in this issue, but may I ask if there is any package like BTW, it is needed to write test cases. |
Hi @huxuan, thanks for taking interest in this!
Could you explain how you want to achieve multiple error messages in one process by this, as |
Hi @chrysle
If I understand correctly, the error log overridden problem only happen when there are multiple error messages. As mentioned in the comment here, I am trying to reach the same situation. Maybe I am going in the wrong direction, any clues on how to fix this issue? |
The problem here seems to be |
So you mean we should change the strategy for error log? Maybe something like the virtual environment problems, which is gathered first and output after everything is finished? |
Like pipx/src/pipx/commands/reinstall.py Lines 139 to 140 in 5482fac
|
Thanks for the clarification, I will try to submit a pull request then. |
Hi @chrysle, I created a pull request [1] as discussed, but I realized that it may not be the same problem as this issue. Maybe a scenario for this issue is a new Python version is released but more than one tool have not support it yet. At this time And the root cause of this problem is that the [1] #1348 Line 327 in 5482fac
[3] Line 261 in 5482fac
|
Yes, this is the core issue.
I can't follow you, exactly... Yes, said function will only be called if an error is encountered with the installation of a package, but the actual fix for the issue that only the error log for the last failure is available afterwards was already discovered in #1132 (comment) (I think it's correct). What I mean to do is to enable installing multiple failing packages with |
You're welcome, and thank you for all the work you've done for |
Describe the bug
When running
pipx reinstall-all --python "python3.12"
and getting error logs from multiple reinstallations, the logs are overwritten.Each reinstallation should get its own log path, or logs should be appended to and not overwritten.
How to reproduce
TypeError: rmtree() got an unexpected keyword argument 'onexc'
#1090)/Users/USERNAME/.local/pipx/logs/cmd_2023-12-03_14.10.06_pip_errors.log
Expected behavior
The logs are appended to, rather than overwritten.
Details
This is the terminal output I get:
Note that all the error file paths are the same:
/Users/corneliusromer/.local/pipx/logs/cmd_2023-12-03_14.10.06_pip_errors.log
When I open that file, I see only error output from the last command invoked, earlier error logs are overwritten.
The text was updated successfully, but these errors were encountered: