fix(cmdeploy): remove broken venv

Failed on system upgrade with
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
This commit is contained in:
j4n
2026-06-11 07:55:58 +02:00
parent 6c0c324944
commit 1aa8139a90
+9
View File
@@ -98,6 +98,15 @@ def _install_remote_venv_with_chatmaild(deployer) -> None:
dest=remote_dist_file,
)
# Remove venv if its Python is broken, e.g., after OS release upgrade
server.shell(
name="remove stale chatmaild venv if python is broken",
commands=[
f"{remote_venv_dir}/bin/python -c 'import sys' 2>/dev/null"
f" || rm -rf {remote_venv_dir}",
],
)
pip.virtualenv(
name=f"chatmaild virtualenv {remote_venv_dir}",
path=remote_venv_dir,