crashes on Python 3.14 due to nested argument groups in argparse
Author: Massimo-BCreated Jun 28, 2026Updated Jul 31, 2026
Environment:
- Powerline: latest (Gentoo
app-misc/powerline) - Python: 3.14.6
- OS: Gentoo Linux
Description:
powerline-daemon fails to start on Python 3.14. Python 3.14 enforces a stricter argparse contract: calling add_argument_group() on a _MutuallyExclusiveGroup now raises a ValueError instead of silently succeeding.
Traceback:
Traceback (most recent call last):
File ".../powerline-daemon", line 495, in <module>
main()
File ".../powerline-daemon", line 423, in main
parser = get_daemon_argparser()
File ".../powerline/commands/daemon.py", line 21, in get_argparser
replace_group = exclusive_group.add_argument_group()
File ".../argparse.py", line 1795, in add_argument_group
raise ValueError('argument groups cannot be nested')
ValueError: argument groups cannot be nestedRoot cause:
powerline/commands/daemon.py, line 21: exclusive_group.add_argument_group() — nesting an argument group inside a mutually exclusive group was never a documented argparse API and is now explicitly rejected in Python 3.14, (see cpython#127133 or similar).
Suggested fix:
Add arguments directly to exclusive_group instead of creating a nested group:
# Before
replace_group = exclusive_group.add_argument_group()
replace_group.add_argument('--replace', ...)
# After
exclusive_group.add_argument('--replace', ...)Impact: powerline-daemon is completely non-functional on Python 3.14.
Source: powerline/powerline