Message313651
Adding a bit of context from my prior email discussion with Hartmut: CPython actually reads sys.warnoptions at the end of Py_Initialize (its the last thing we do before the function returns).
It also reads sys._xoptions during startup, since that's one way of enabling settings like dev mode and UTF-8 mode.
That means that even though PySys_AddWarnOption and PySys_AddXOption weren't documented as being safe to call before Py_Initialize, they likely *won't* have the desired effect if an embedding application defers calling them until later, and their absence from the list of "safe to call before Py_Initialize" functions was itself a documentation bug.
For 3.8, I'd hoped that the resolution might be as simple as a hard requirement on embedding applications to call PyRuntime_Initialize() before doing *anything* with the C API, but including the "internal/pystate.h" header and adding a call to _PyRuntime_Initialize() wasn't enough to keep the draft test case in my patch from segfaulting :( |
|
Date |
User |
Action |
Args |
2018-03-12 14:02:34 | ncoghlan | set | recipients:
+ ncoghlan, htgoebel, vstinner, eric.snow |
2018-03-12 14:02:34 | ncoghlan | set | messageid: <1520863354.29.0.467229070634.issue33042@psf.upfronthosting.co.za> |
2018-03-12 14:02:34 | ncoghlan | link | issue33042 messages |
2018-03-12 14:02:34 | ncoghlan | create | |
|