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 on -- arg separator #846

Closed
roussak opened this issue Oct 2, 2024 · 2 comments
Closed

Unhandled exception on -- arg separator #846

roussak opened this issue Oct 2, 2024 · 2 comments
Labels
bug Something isn't working upstream issue

Comments

@roussak
Copy link

roussak commented Oct 2, 2024

pikaur -Vq

Pikaur v1.30.1.r0.g07ae545f
Pacman v7.0.0 - libalpm v15.0.0 - pyalpm v0.10.6
Description:

Trying to run the pikaur with partially given name causes its crash:

$  pikaur -Qsq -- '-git'
Traceback (most recent call last):
  File "/bin/pikaur", line 41, in <module>
    main()
  File "/usr/lib/python3.12/site-packages/pikaur/main.py", line 494, in main
    with wrapper():
         ^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/main.py", line 107, in __enter__
    logger.debug(
  File "/usr/lib/python3.12/site-packages/pikaur/logging_extras.py", line 81, in debug
    msg = f"{color_line(self.module_name, self.color)}: {' ' * indent}{str_message}"
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/pikaprint.py", line 189, in color_line
    if not color_enabled() and not force:
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/pikaprint.py", line 91, in color_enabled
    args = parse_args()
           ^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/args.py", line 819, in parse_args
    parsed_args, _help = _parse_args(args=args)
                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/args.py", line 778, in _parse_args
    parser, help_msgs = get_parser_for_action(app=app_name, args=args)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/args.py", line 737, in get_parser_for_action
    parsed_action = parser.parse_pikaur_args(args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/args.py", line 623, in parse_pikaur_args
    parsed_args, unknown_args = self.parse_known_args(raw_args)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/argparse.py", line 1932, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/argparse_extras.py", line 293, in _parse_known_args
    stop_index = consume_positionals(start_index)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pikaur/argparse_extras.py", line 249, in consume_positionals
    args.remove(LONG_ARG_PREFIX)
ValueError: list.remove(x): x not in list

While the pacman gives the packages list with '-git' at the end of the name.

@roussak
Copy link
Author

roussak commented Oct 2, 2024

Downgrading to the pikaur-git-1.29.1.r0.g668e801e eliminates the issue.

@actionless actionless changed the title Crash on -- '-name-part' Unhandled exception on -- '-name-part' Oct 2, 2024
@actionless actionless added bug Something isn't working upstream issue labels Oct 2, 2024
@actionless
Copy link
Owner

@actionless actionless changed the title Unhandled exception on -- '-name-part' Unhandled exception on -- arg separator Oct 2, 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 upstream issue
Projects
None yet
Development

No branches or pull requests

2 participants