mirror of
https://github.com/chatmail/relay.git
synced 2026-06-11 22:21:11 +00:00
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:
@@ -98,6 +98,15 @@ def _install_remote_venv_with_chatmaild(deployer) -> None:
|
|||||||
dest=remote_dist_file,
|
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(
|
pip.virtualenv(
|
||||||
name=f"chatmaild virtualenv {remote_venv_dir}",
|
name=f"chatmaild virtualenv {remote_venv_dir}",
|
||||||
path=remote_venv_dir,
|
path=remote_venv_dir,
|
||||||
|
|||||||
Reference in New Issue
Block a user