◐ Shell
reader mode source ↗
Skip to content

bpo-34247: actually use environment variables in Py_Initialize#8521

Closed
ronaldoussoren wants to merge 1 commit into
python:3.7from
ronaldoussoren:bpo-34247
Closed

bpo-34247: actually use environment variables in Py_Initialize#8521
ronaldoussoren wants to merge 1 commit into
python:3.7from
ronaldoussoren:bpo-34247

Conversation

@ronaldoussoren

@ronaldoussoren ronaldoussoren commented Jul 28, 2018

Copy link
Copy Markdown
Contributor

As mentioned in bpo-34247 a program embedding Python with Py_Initialize / Py_Run... (no Py_Main) cannot affect a number of interpreter options through environment variables.

This is a pull request against the 3.7 branch, primarily because Nick Coghlan mentioned that there is related work on the master branch by Victor Stinner (bpo-34170).

The patch works for me, but I haven't dug deeply enough in the code to be sure that this is the right patch, I'm particularly unsure about the additional argument to _PyCoreConfig_Read.

https://bugs.python.org/issue34247

…sys.flags

This patch moves a number of startup options from the
_Py_CommandLineDetails to _PyCoreConfig to make it possible to process
them in Py_Initialize, actually uses this and adds a function to update
the relevant global variables from _Py_Initialize.
@vstinner

vstinner commented Aug 3, 2018

Copy link
Copy Markdown
Member

I proposed a different approach: PR #8659.

@vstinner

vstinner commented Aug 5, 2018

Copy link
Copy Markdown
Member

I merged my PR #8659 instead which is more complete and contains unit tests. Thanks for your PR anyway!

@vstinner vstinner closed this Aug 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants