gh-64490: Fix bugs in argument clinic varargs processing by colorfulappl · Pull Request #32092 · python/cpython
added 3 commits
Python allows at most *one* vararg in one function.
Remove the improper varargs check which allows function definition like
```
*vararg1: object
*vararg2: object
```
in argument clinic.
Variable `vararg` indicates the index of vararg in parameter list.
While copying kwargs to `buf`, the index `i` should not add `vararg`, which leads to an out-of-bound bug.
When there are positional args, vararg and keyword args in a function definition, in which case `vararg` > 1, this bug can be triggered.
e.g.
```
pos: object
*args: object
kw: object
```
erlend-aasland
changed the title
bpo-20291: Fix bugs in argument clinic varargs processing
gh-64490: Fix bugs in argument clinic varargs processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters