Hi, I encouraged Ritesh to inform the Debian team of this one. But I'm now satisfied fault lays with Xonsh (and PDM, and up to 750 other libraries). So I think this bug can be closed.
I was wondering why the bug hasn't been seen on any other OS, or with a Python from uv. But I now think this might be a credit to Debian's community of testers, all using Trixie, who simply discovered it first! All the ~754 projects I found on Github contain code that relies on private implementation details of argparse.ArgumentParser._parse_known_args. It did occur in PDM too, also on Debian Trixie, but the PDM devs fixed it first. In Python 3.12.7, these implementation details changed, adding an extra arg, In an instance of a subclass of ArgumentParser, calls via super to the new methods on the base class, themselves call the old overrided methods on self, but using the new call signature of _parse_known_args with the extra arg. This obviously causes a type error about an unexpected 4th arg, in libraries whose overidden methods don't accept *args. Best regards, James. Sent with [Proton Mail](https://proton.me/mail/home) secure email.