Skip to content
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

Unhandled exception with multiple --quiet flags #1283

Closed
yggdr opened this issue Mar 7, 2024 · 0 comments · Fixed by #1284
Closed

Unhandled exception with multiple --quiet flags #1283

yggdr opened this issue Mar 7, 2024 · 0 comments · Fixed by #1284
Labels
bug Something isn't working

Comments

@yggdr
Copy link

yggdr commented Mar 7, 2024

Describe the bug
Giving -q more than twice to commands like list gives unhandled exception:

$ pipx list -qqq
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/config.py", line 564, in configure
    handler = self.configure_handler(handlers[name])
  File "/usr/local/lib/python3.9/logging/config.py", line 758, in configure_handler
    result.setLevel(logging._checkLevel(level))
  File "/usr/local/lib/python3.9/logging/__init__.py", line 198, in _checkLevel
    raise ValueError("Unknown level: %r" % level)
ValueError: Unknown level: 'Level 60'

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

Traceback (most recent call last):
  File "/usr/local/bin/pipx", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/pipx/main.py", line 916, in cli
    setup(parsed_pipx_args)
  File "/usr/local/lib/python3.9/site-packages/pipx/main.py", line 856, in setup
    setup_logging(verbose)
  File "/usr/local/lib/python3.9/site-packages/pipx/main.py", line 846, in setup_logging
    logging.config.dictConfig(logging_config)
  File "/usr/local/lib/python3.9/logging/config.py", line 809, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/local/lib/python3.9/logging/config.py", line 571, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'stream'

How to reproduce

pipx list -qq works fine, pipx list -qqq does not.

Expected behavior

Either ignore the superfluous q-flags, or print a notice about the number of times this subcommand accepts the flag.

@chrysle chrysle added the bug Something isn't working label Mar 7, 2024
@chrysle chrysle changed the title Unhandled exception with multiple quite flags Unhandled exception with multiple --quiet flags Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants