v0.6.0 BigUpdate
This commit is contained in:
@@ -37,13 +37,20 @@ def _office_program_dir(install: OfficeInstall) -> Path | None:
|
||||
def _uno_worker_env(worker_dir: Path, install: OfficeInstall) -> tuple[dict[str, str], Path]:
|
||||
"""Build env + cwd so bundled ``program/python.exe`` can ``import uno``."""
|
||||
env = os.environ.copy()
|
||||
# System Python's PYTHONHOME/PYTHONPATH confuse LO's embedded interpreter
|
||||
# ("Could not find platform independent libraries <prefix>").
|
||||
for key in (
|
||||
"PYTHONHOME",
|
||||
"PYTHONPATH",
|
||||
"PYTHONUSERBASE",
|
||||
"VIRTUAL_ENV",
|
||||
"CONDA_PREFIX",
|
||||
):
|
||||
env.pop(key, None)
|
||||
program_dir = _office_program_dir(install)
|
||||
path_parts = [str(worker_dir)]
|
||||
if program_dir is not None:
|
||||
path_parts.append(str(program_dir))
|
||||
existing = env.get("PYTHONPATH", "")
|
||||
if existing:
|
||||
path_parts.append(existing)
|
||||
env["PYTHONPATH"] = os.pathsep.join(path_parts)
|
||||
env.setdefault("PYTHONIOENCODING", "utf-8")
|
||||
if install.soffice_path:
|
||||
|
||||
Reference in New Issue
Block a user