| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Hum, I tried the following change: diff --git a/Modules/main.c b/Modules/main.c
index 853afedd7b..471dd0803c 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -65,6 +65,11 @@ pymain_init(const _PyArgv *args)
return status;
}
+ status = PyConfig_SetString(&config, &config.exec_prefix, L"/victor");
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+
/* pass NULL as the config: config is read from command line arguments,
environment variables, configuration files */
if (args->use_bytes_argv) {
It works for me: $ ./python -c 'import sys; print(sys.exec_prefix)' /victor |
Sorry, something went wrong.
|
I think I was expecting that updating the prefix would be enough to locate the files under the prefix, but that doesn't work - it still comes up with the wrong sys.path default. So it's probably best to set home and let it infer prefix and exec_prefix. Thanks for your other comments! |
Sorry, something went wrong.
Python Path Configuration is a black box. Nobody knows how it works! :-D |
Sorry, something went wrong.
|
I'm going to give this one more review in the morning with fresh eyes (and coffee), but it should basically match the fix that's gone in for 3.7 already. This one defines more new API rather than just using a hack though (but I still want it in for the next 3.8.0 beta). |
Sorry, something went wrong.
… for linking sys.executable
|
Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
|
Sorry, @zooba, I could not cleanly backport this to 3.8 due to a conflict. |
Sorry, something went wrong.
… container (pythonGH-14428) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
|
GH-14467 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
… container (pythonGH-14428) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
… container (pythonGH-14428) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue37369