Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Greetings,

I notice that the initialization mechanism for the runtime simply calls Py_Initialize or Py_InitializeEx. There's currently no clear way to, for instance, pass the -I flag to the runtime to set up an isolated config, without controlling the process environment variables. This has some security considerations for my desired use case; the concerns are not unmanageable, but the workarounds are a little clumsy. More generally, this seems like the kind of useful option that would couple well with an embedded python environment (e.g. through Python.Deployment) which I suspect constitutes a large percentage of pythonnet use cases.

With support for Py_InitializeFromConfig and some means of generating the PyPreConfig and PyConfig objects (effectively just support for some of the security-conscious options on the runtime such as -I or -P), I think this would be a lot more straightforward. If there's some technical considerations that would make this challenging, I'm curious to hear them: since pythonnet is open-source, I may take a crack at patching in an overload to the PythonEngine.Initialize that lets me specify some of the security-conscious arguments for isolated configs, and I'd like to know if anything like this was attempted or considered in the past.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.