pipx
pipx copied to clipboard
Debug messages are still displayed after upgrade
Describe the bug
Debug messages are displayed throughout the program. I looked for an environment variable that maybe I had set and couldn't find anything. Then I looked over the program and found where the logger was set. I believe that changing DEBUG to ERROR (if that's another logging level in Python) will fix it.
Also, unsure if this was intentional or not
Editing to say that I wouldn't made a pull request, but I didn't think that changing a single word was worth doing that
How to reproduce Install to the newest version and run any command
Expected behavior Debug messages are on nearly every line
DEBUG:pipx.main:2022-01-30 22:39:38
DEBUG:pipx.main:/home/lucas/.local/share/pyenv/versions/3.10.0/bin/pipx list
INFO:pipx.main:pipx version is 1.0.0
INFO:pipx.main:Default python interpreter is '/home/lucas/.local/share/pyenv/versions/3.10.0/bin/python'
INFO:pipx.shared_libs:Time since last upgrade of shared libs, in seconds: 739. Upgrade will be run by pipx if greater than 25920
How to fix
Change the line in main.py which says:
# from
"loggers": {"pipx": {"handlers": ["stream", "file"], "level": "DEBUG"}},)
# to
"loggers": {"pipx": {"handlers": ["stream", "file"], "level": "ERROR"}},)
Hi @lmburns, could you provide more information here? For example, your OS and the command that you were running? Thanks!
The normal output of pipx list is something like this:
$ pipx list
venvs are in /home/user/.local/pipx/venvs
apps are exposed on your $PATH at /home/user/.local/bin
package pycowsay 0.0.0.1, installed using Python 3.8.10
- pycowsay
Here is some information:
$ uname -a
Linux archbox 5.16.8-arch1-1 #1 SMP PREEMPT Tue, 08 Feb 2022 21:21:08 +0000 x86_64 GNU/Linux
$ pipx --version
1.0.0
$ pyenv --version
pyenv 2.2.4
$ python --version
Python 3.10.0
It was any pipx command that would display debugging messages. pipx list, pipx install, etc. After I went to $PYENV_ROOT/versions/3.10.0/lib/python3.10/site-packages/pipx and changed that line, the debugging messages seemed to disappear.
I was unsure if this was a pipx problem or not. I thought that it was since I had only noticed the debugging messages when using pipx and they seemed to stop after changing that line. However, after I filed this bug, I noticed that there was another Python program displaying debugging messages, though I cannot remember which one it was.
The issue started after upgrading pipx. I cannot remember if I upgraded it just because or if it was whenever I switched my Python version from 3.9.5 to 3.10.0 using pyenv.
I checked to see whether the logging framework with Python used some sort of environment variable and couldn't find anything. I went through some of the environment variables that I had set to see if I could maybe find something and couldn't find anything either. I just went and modified the file as mentioned above and changed it back from ERROR to DEBUG and the messages started showing again.
Here it is in action

I am not able to reproduce it on Ubuntu with Python 3.10.0, pyenv 2.2.4 and pipx 1.0.0.
However, after I filed this bug, I noticed that there was another Python program displaying debugging messages, though I cannot remember which one it was.
I guess it would be less possible that it is a pipx issue then, although it is strange.
The issue started after upgrading pipx. I cannot remember if I upgraded it just because or if it was whenever I switched my Python version from 3.9.5 to 3.10.0 using pyenv.
Could you downgrade pipx and see if it still has this issue?
I downgraded pipx to 0.17.0 and the same thing is going on. Whenever I change it from DEBUG to ERROR the messages go away. Once my mac laptop gets done upgrading I'm going to try the same thing on there and see if I have the same issues.
Do you know of any sort of environment variable that this could be reading from? I'm not really sure of anything else, unless pyenv or python was compiled with some sort of flag that enables persistent debugging
Also switched from python 3.10.0 to 3.9.5 and installed pipx version 1.0.0 and see debugging messages
Edit: That my mac laptop does not seem to have this issue either.
I just find it odd how I can change one word in a file to stop the debug messages from being displayed, but I am unsure if it is pipx that is actually causing this to be the case. I guess after you see this message, if you feel like closing this issue you can. If there is anything that I figure out, I will come back here and post it
Closing this since I believe there is nothing to fix here.