[GH-ISSUE #108] [Bug Report] argparse: cannot use positional argument in mutually exclusive group #94

Closed
opened 2026-02-27 04:57:30 +03:00 by kerem · 2 comments
Owner

Originally created by @damanjit-singh on GitHub (Nov 3, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/108

Originally assigned to: @Googolplexed0 on GitHub.

Zotify Version
v0.10.24

Bug Description
I am running efficient-api branch version and my Python version is 3.11.11 on Oracle Linux Server 9.4. Running zotify gives this:

Traceback (most recent call last):
  File "/home/opc/.local/bin/zotify", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/opc/.local/share/pipx/venvs/zotify/lib64/python3.11/site-packages/zotify/__main__.py", line 79, in main
    group.add_argument('urls',
  File "/usr/lib64/python3.11/argparse.py", line 1473, in add_argument
    return self._add_action(action)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/argparse.py", line 1702, in _add_action
    raise ValueError(msg)
ValueError: mutually exclusive arguments must be optional

Bug Triggering Command
zotify

Originally created by @damanjit-singh on GitHub (Nov 3, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/108 Originally assigned to: @Googolplexed0 on GitHub. **Zotify Version** v0.10.24 **Bug Description** I am running efficient-api branch version and my Python version is 3.11.11 on Oracle Linux Server 9.4. Running zotify gives this: ``` Traceback (most recent call last): File "/home/opc/.local/bin/zotify", line 7, in <module> sys.exit(main()) ^^^^^^ File "/home/opc/.local/share/pipx/venvs/zotify/lib64/python3.11/site-packages/zotify/__main__.py", line 79, in main group.add_argument('urls', File "/usr/lib64/python3.11/argparse.py", line 1473, in add_argument return self._add_action(action) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/argparse.py", line 1702, in _add_action raise ValueError(msg) ValueError: mutually exclusive arguments must be optional ``` **Bug Triggering Command** zotify
kerem 2026-02-27 04:57:30 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@damanjit-singh commented on GitHub (Nov 3, 2025):

Looks like the solution is to replace:

group.add_argument('urls')

with:

group.add_argument('--urls') in main.py

<!-- gh-comment-id:3481863368 --> @damanjit-singh commented on GitHub (Nov 3, 2025): Looks like the solution is to replace: `group.add_argument('urls')` with: `group.add_argument('--urls')` in __main__.py
Author
Owner

@Googolplexed0 commented on GitHub (Nov 4, 2025):

group.add_argument('--urls')

While this change does solve the error, it changes url into an argument that must be explicitly specified. This goes against the preferred usage, where a commands may be as simple as zotify <url>, with no --url argument in-between. I think I found an alternate fix.

<!-- gh-comment-id:3483393031 --> @Googolplexed0 commented on GitHub (Nov 4, 2025): > group.add_argument('--urls') While this change does solve the error, it changes `url` into an argument that must be explicitly specified. This goes against the preferred usage, where a commands may be as simple as `zotify <url>`, with no `--url` argument in-between. I think I found an alternate fix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zotify#94
No description provided.