Closed mfussenegger closed 10 months ago
Hi @mfussenegger, thank you for the detailed report!
Confirming the regression. The fix is ready, to be released as 0.30.1 today or later this week.
Re not-so-smooth migration to the new name mapping policy: very good point, I've added a more informative error there with a hint to the possible solution.
FYI, I was indeed planning a smooth transition but the path with deprecation warnings would mean the necessity to update absolutely every app with an explicit policy and then deprecate the legacy policy. It would be far longer and require much more intervention from app developers. This way they have three options: a) stay at v0.29, b) upgrade but stay with the legacy policy, c) upgrade and add that asterisk.
Anyway, thanks for the valuable feedback, I was a bit nervous about this one when preparing the release 😄
Re not-so-smooth migration to the new name mapping policy: very good point, I've added a more informative error there with a hint to the possible solution.
I think part of the problem was that I first looked at the Github release (https://github.com/neithere/argh/releases/tag/v0.30.0). That led me to https://github.com/neithere/argh/pull/199
If I had looked at the changes file it would've been much clearer. I thought maybe there was another issue preventing the smooth migration from working.
It looks like there was a regression in the assembling refactor. The following used to work:
Since 0.30.0 it results in the following stacktrace:
I suspect it can't picke
sys.stdin
?Side note: Was it intentional that the keyword-only arguments become already mandatory? https://github.com/neithere/argh/issues/191 mentioned a smooth transition path.
If you change the above example to:
It fails with
argh.exceptions.AssemblingError: foo: argument "x" declared as positional (in function signature) and optional (via decorator)
Not that big of a deal and easy enough to adjust, but given that the issue mentions that there should be a smooth migration I wanted to mention it too.