> Maybe something to do with setting a weird PIPX_HOME ?

Good catch. As root:

===8<----------------------------------------
$ PIPX_HOME=${prefix:-/opt/}/pipx PIPX_BIN_DIR=${prefix:-/usr/local}/bin pipx 
list
venvs are in /opt/pipx/venvs
apps are exposed on your $PATH at /usr/local/bin
   package argostranslate 1.9.6, installed using Python 3.11.2
    - argos-translate
    - argospm
===8<----------------------------------------

As user:
===8<----------------------------------------
$ PIPX_HOME=${prefix:-/opt/}/pipx PIPX_BIN_DIR=${prefix:-/usr/local}/bin pipx 
list
Traceback (most recent call last):
  File "/usr/lib/python3.11/logging/config.py", line 562, in configure
    handler = self.configure_handler(handlers[name])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/config.py", line 747, in configure_handler
    result = factory(**kwargs)
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/__init__.py", line 1181, in __init__
    StreamHandler.__init__(self, self._open())
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/__init__.py", line 1213, in _open
    return open_func(self.baseFilename, self.mode,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: 
'/opt/pipx/logs/cmd_2024-05-03_20.14.46.log'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/pipx", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/lib/python3/dist-packages/pipx/main.py", line 814, in cli
    setup(parsed_pipx_args)
  File "/usr/lib/python3/dist-packages/pipx/main.py", line 753, in setup
    setup_logging("verbose" in args and args.verbose)
  File "/usr/lib/python3/dist-packages/pipx/main.py", line 745, in setup_logging
    logging.config.dictConfig(logging_config)
  File "/usr/lib/python3.11/logging/config.py", line 812, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib/python3.11/logging/config.py", line 569, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'file'
===8<----------------------------------------

Which is discussed here:

  https://github.com/pypa/pipx/issues/754#issuecomment-1181082995

I granted read access to /opt/pipx/logs/ for users and it made no
difference. I’ll just have to use root to list pkgs and call it good
enough for me. But certainly it’s a bug for pipx to crash and give a
stack dump. In the very least it should give a specific user-readable
error msg.

Reply via email to