Open Omicronlawful opened 1 year ago
Can confirm that the following configs remove the "encoding" error.
OxidizedPythonInterpreterConfig::default();
config.interpreter_config.isolated = Some(true);
config.interpreter_config.filesystem_encoding = Some("utf-8".to_string());
config.set_missing_path_configuration = false;
config.interpreter_config.parse_argv = Some(false);
config.argv = Some(vec!["python".into()]);
config.interpreter_config.executable = Some("python".into());
Failures in init_fs_encoding()
are almost always a red herring: the actual failure is the Python standard library .py files cannot be located/loaded. This materializes as a failure to locate the module providing the encoding used by the filesystem and that causes Python's interpreter initialization to barf. (There is room to handle this error better in pyembed.)
I am using macos and venv. I am trying to run python code with pyembed. I tried setting filesystem_encoding and the python path to the python from the venv
I took this from the bench and it works. I think the default should be updated to work out of the box.