Commit 9e5036f1 authored by Michal Čihař's avatar Michal Čihař

Always set own home directory

This way we avoid problems when running in web server environment with
no HOME set.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent ee0d12a4
......@@ -28,6 +28,7 @@ import os
import urlparse
import hashlib
import weblate
from weblate.trans.data import data_dir
try:
import rollbar
......@@ -156,11 +157,12 @@ def get_clean_env(extra=None):
Returns cleaned up environment for subprocess execution.
"""
environ = {
'LANG': 'en_US.UTF-8'
'LANG': 'en_US.UTF-8',
'HOME': data_dir('home'),
}
if extra is not None:
environ.update(extra)
variables = ('HOME', 'PATH', 'LD_LIBRARY_PATH')
variables = ('PATH', 'LD_LIBRARY_PATH')
for var in variables:
if var in os.environ:
environ[var] = os.environ[var]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment