Skip to content

Fix duplicate values in Config.known_args_namespace for append actions#14422

Open
EternalRights wants to merge 3 commits intopytest-dev:mainfrom
EternalRights:fix-known-args-namespace-duplicate
Open

Fix duplicate values in Config.known_args_namespace for append actions#14422
EternalRights wants to merge 3 commits intopytest-dev:mainfrom
EternalRights:fix-known-args-namespace-duplicate

Conversation

@EternalRights
Copy link
Copy Markdown
Contributor

Ran into #13484 while looking at the config parsing code. The third parse_known_args call passes self.known_args_namespace as the namespace, which already has values from the second parse. For action="append" options like -W, this causes duplicates.

Fix is to use copy.copy(self.option) instead, same as the first two calls. This way each parse starts from a clean namespace and append actions don't accumulate across multiple parses.

Not sure if there was a reason the third call used known_args_namespace directly, but from what I can tell the only new things after the second parse are plugin-registered options, and those would still be picked up correctly with a fresh namespace.

Closes #13484

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config.known_args_namespace contains duplicate value

1 participant