Univention Bugzilla – Bug 54882
univention-l10n crashes if called without arguments
Last modified: 2022-07-18 08:56:55 CEST
When univention-l10n is called from the command line without any arguments, the program crashes with the following output: Traceback (most recent call last): File "/usr/bin/univention-l10n", line 11, in <module> load_entry_point('univention-l10n===7.0.1-3A-5.0.0.202201281923', 'console_scripts', 'univention-l10n')() File "/usr/lib/python3/dist-packages/univention/l10n/cmd.py", line 44, in main parse_args(cmd) File "/usr/lib/python3/dist-packages/univention/l10n/cmd.py", line 90, in parse_args args.func(args) AttributeError: 'Namespace' object has no attribute 'func' Expected Output: Program runs or provides a message which explains what the program does and what arguments can be provided.
See [argparse.ArgumentParser.add_subparsers(…, required=True)](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers) was added with 3.7 and changed the default from `True` to `False`; there is already a comment in line 72 for that as we were still using python2.7 back than and it was overlooked when we switched to Python 3. sed -re '/add_subparsers/s/\) #( required=True)/,\1)/' -i packaging/univention-l10n/univention/l10n/cmd.py