]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42260: PyConfig_Read() only parses argv once (GH-23168)
authorVictor Stinner <vstinner@python.org>
Thu, 5 Nov 2020 17:58:07 +0000 (18:58 +0100)
committerGitHub <noreply@github.com>
Thu, 5 Nov 2020 17:58:07 +0000 (18:58 +0100)
commitdc42af8fd16b10127ce1fc93c13bc1bfd2674aa2
tree4d45407632e738acb07a54af480d16c7fadef8b4
parentf3cb81431574453aac3b6dcadb3120331e6a8f1c
bpo-42260: PyConfig_Read() only parses argv once (GH-23168)

The PyConfig_Read() function now only parses PyConfig.argv arguments
once: PyConfig.parse_argv is set to 2 after arguments are parsed.
Since Python arguments are strippped from PyConfig.argv, parsing
arguments twice would parse the application options as Python
options.

* Rework the PyConfig documentation.
* Fix _testinternalcapi.set_config() error handling.
* SetConfigTests no longer needs parse_argv=0 when restoring the old
  configuration.
Doc/c-api/init_config.rst
Lib/test/_test_embed_set_config.py
Lib/test/test_embed.py
Misc/NEWS.d/next/C API/2020-11-05-18-02-07.bpo-42260.pAeaNR.rst [new file with mode: 0644]
Modules/_testinternalcapi.c
Python/initconfig.c