v0.6.0 BigUpdate
Example document / build (push) Has been cancelled
Python application / build (push) Has been cancelled

This commit is contained in:
Igor20264
2026-10-20 11:38:06 +03:00
parent daa84f8bce
commit 8223e0ac14
77 changed files with 12158 additions and 117 deletions
+10 -3
View File
@@ -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: