Argparse API change breaks argcomplete

Bug #2063129 reported by Matthias Lüscher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-argcomplete (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Description: Ubuntu Noble Numbat (development branch)
Release: 24.04
python3-argcomplete: 3.1.4-1

Python argparse introduced an API change that breaks argcomplete. The upstream version of argcomplete got fixed here: https://github.com/kislyuk/argcomplete/commit/54a4846b3a774cd9037167898f3cce38ba9d58e8

I detected the issue using my python based tool edi. The issue can be reproduced as follows:

1. Install edi according to https://docs.get-edi.io/en/latest/getting_started.html#installing-edi-from-the-package-repository
2. Start to type "edi -v project" and hit tab for auto completion. The first level sub command will be proposed instead of the second level subcommand.
3. Patch /usr/lib/python3/dist-packages/argcomplete/packages/_argparse.py according to the above commit.
4. Start to type "edi -v project" and hit tab for auto completion. The correct second level commands such as "make" will be proposed.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-argcomplete - 3.3.0-1

---------------
python-argcomplete (3.3.0-1) unstable; urgency=medium

  * Team upload.
  * New upstream release:
    - Preserve compatibility with argparse option tuples of length 4. This
      update is required to use argcomplete on Python 3.11.9+ or 3.12.3+
      (closes: #1069816, LP: #2063129).
  * Mention zsh in package description (closes: #1061780).

 -- Colin Watson <email address hidden> Fri, 26 Apr 2024 13:28:45 +0100

Changed in python-argcomplete (Ubuntu):
status: New → Fix Released
Revision history for this message
Matthias Lüscher (m-luescher) wrote :

It would be cool if the fix could get backported to Ubuntu 24.04 LTS too!

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.