diff options
author | Peter Bierma <zintensitydev@gmail.com> | 2024-10-31 14:14:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 14:14:37 (GMT) |
commit | 01415213d72504eafc159721a8f55d57b374fd9c (patch) | |
tree | b807990380d31ed9096230f9e08de0228fc23e85 /Modules | |
parent | 8c22eba877225ab29cd64672dcb97f09a5f7336f (diff) | |
download | cpython-01415213d72504eafc159721a8f55d57b374fd9c.zip cpython-01415213d72504eafc159721a8f55d57b374fd9c.tar.gz cpython-01415213d72504eafc159721a8f55d57b374fd9c.tar.bz2 |
gh-126223: Propagate unicode errors in `_interpreters.create()` (#126224)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_interpretersmodule.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_interpretersmodule.c b/Modules/_interpretersmodule.c index 6f3392f..63f2bb3 100644 --- a/Modules/_interpretersmodule.c +++ b/Modules/_interpretersmodule.c @@ -402,7 +402,11 @@ config_from_object(PyObject *configobj, PyInterpreterConfig *config) } } else if (PyUnicode_Check(configobj)) { - if (init_named_config(config, PyUnicode_AsUTF8(configobj)) < 0) { + const char *utf8name = PyUnicode_AsUTF8(configobj); + if (utf8name == NULL) { + return -1; + } + if (init_named_config(config, utf8name) < 0) { return -1; } } |