cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-98718: add sys.build_prefix

Open FFY00 opened this issue 2 years ago • 3 comments

Alternative to #98719, but exporting sys.build_prefix.

  • Issue: gh-98718

FFY00 avatar Nov 09 '22 03:11 FFY00

I wonder if, rather than plumbing this the whole way through, we can simply assign it to the sys module in getpath.py? There's no real value in making this configurable, and honestly I'd rather remove or fix anything that requires this.

zooba avatar Nov 09 '22 20:11 zooba

Yes, I think that makes sense.

By configurable you are referring to setting it when embedding, right? I was under the impression we needed further changes to make that actually work.

FFY00 avatar Nov 10 '22 00:11 FFY00

By configurable you are referring to setting it when embedding, right? I was under the impression we needed further changes to make that actually work.

Just needs to be put into PyConfig and set up to be cleared/copied (as you've done). But on second thoughts, you're not going to be able to set the sys module directly here anyway, so probably it needs to go back into PyConfig at this stage.

If we're to go ahead with this, I'd make the PyConfig field private (leading underscore). Or if we can come up with a better way to set up the sys module from within getpath.py, I'd like that more.

zooba avatar Nov 10 '22 20:11 zooba