GNU bash, Version 5.1.4(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder jünger <http://gnu.org/licenses/gpl.html>
Dies ist freie Software. Sie darf verändert und verteilt werden.
Es wird keine Garantie gewährt, soweit das Gesetz es zulässt.
This causes clicks shell completion activation to die with an exception because of the capitalized V in Version:
Traceback (most recent call last):
File "/home/losinski/.local/bin/template-test", line 8, in <module>
sys.exit(main())
File "/home/losinski/.local/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/losinski/.local/lib/python3.9/site-packages/click/core.py", line 1057, in main
self._main_shell_completion(extra, prog_name, complete_var)
File "/home/losinski/.local/lib/python3.9/site-packages/click/core.py", line 1132, in _main_shell_completion
rv = shell_complete(self, ctx_args, prog_name, complete_var, instruction)
File "/home/losinski/.local/lib/python3.9/site-packages/click/shell_completion.py", line 45, in shell_complete
echo(comp.source())
File "/home/losinski/.local/lib/python3.9/site-packages/click/shell_completion.py", line 324, in source
self._check_version()
File "/home/losinski/.local/lib/python3.9/site-packages/click/shell_completion.py", line 319, in _check_version
raise RuntimeError(
RuntimeError: Couldn't detect Bash version, shell completion is not supported.
bash -c 'echo ${BASH_VERSION}'
5.1.4(1)-release
I have a machine where the system locale is set to
de_DE.UTF-8. The output ofbash --versionhere is:This causes clicks shell completion activation to die with an exception because of the capitalized
VinVersion:A quickfix would be to set
LANG=Cas environment on thebash --versioncall here: https://github.com/pallets/click/blob/main/src/click/shell_completion.py#L305. Another option would beEnvironment: