theRealCarneiro / pulsemeeter

Replicating voicemeeter routing functionalities in linux with pulseaudio
MIT License
389 stars 20 forks source link

[Bug] overall help not working (CLI error) #58

Closed Fl1tzi closed 2 years ago

Fl1tzi commented 2 years ago

Describe the bug When running pulsemeeter -h or pulsemeeter --help the command produces an error.

Expected behavior printing the help

log

❯ pulsemeeter --help
Traceback (most recent call last):
  File "/usr/bin/pulsemeeter", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/pulsemeeter/__main__.py", line 514, in main
    create_parser_args()
  File "/usr/lib/python3.10/site-packages/pulsemeeter/__main__.py", line 322, in create_parser_args
    args = parser.parse_args()
  File "/usr/lib/python3.10/argparse.py", line 1825, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 1858, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 2067, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.10/argparse.py", line 2007, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.10/argparse.py", line 1935, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.10/argparse.py", line 1098, in __call__
    parser.print_help()
  File "/usr/lib/python3.10/argparse.py", line 2555, in print_help
    self._print_message(self.format_help(), file)
  File "/usr/lib/python3.10/argparse.py", line 2539, in format_help
    return formatter.format_help()
  File "/usr/lib/python3.10/argparse.py", line 283, in format_help
    help = self._root_section.format_help()
  File "/usr/lib/python3.10/argparse.py", line 214, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.10/argparse.py", line 214, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.10/argparse.py", line 501, in _format_text
    return self._fill_text(text, text_width, indent) + '\n\n'
  File "/usr/lib/python3.10/argparse.py", line 650, in _fill_text
    text = self._whitespace_matcher.sub(' ', text).strip()
TypeError: expected string or bytes-like object

Python Version 3.10.4

Additional context It somehow works on another device of me.

Fl1tzi commented 2 years ago

Okay I found the error. It was introduced by @theRealCarneiro with the pep 8 commit.

git blame: https://github.com/theRealCarneiro/pulsemeeter/blame/main/pulsemeeter/__main__.py#L286-L288

Going to create a pr soon.

Fl1tzi commented 2 years ago

fixed with #60