cliff complete option is broken with error Unknown shell syntax

Bug #2137246 reported by Kaushik K R
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
New
Undecided
Unassigned

Bug Description

Python Version: 3.13.11

Cliff version: 4.13.1

With the latest Python, cliff complete option is broken with error "Unknown shell syntax" because for bash self._formatters[parsed_args.shell].plugin is null.

To handle it, defined new custom class in cliff/complete.py

```
class CustomBashCompletion:
    """Shim to emulate importlib/pkg_resources entry point"""
    def __init__(self, plugin):
        self.plugin = plugin
```

And defined self._formatters = {'bash': CustomBashCompletion(CompleteBash)}, even after doing this an additional change was needed in cliff/display.py.

As formatter_choices[0] was null and hence length checking is needed. If length is 0 return the parser. With this complete option started working.

can you please check this can be taken as official commit?

description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.