Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
353cca84
Commit
353cca84
authored
Sep 26, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Execute VCS command in clean environment
Issue #528 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
3ce57e20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
weblate/trans/util.py
weblate/trans/util.py
+11
-0
weblate/trans/vcs.py
weblate/trans/vcs.py
+2
-0
No files found.
weblate/trans/util.py
View file @
353cca84
...
...
@@ -24,6 +24,7 @@ from django.core.cache import cache
from
importlib
import
import_module
import
time
import
random
import
os
PLURAL_SEPARATOR
=
'
\
x1e
\
x1e
'
...
...
@@ -144,3 +145,13 @@ def get_configuration_errors():
Returns all configuration errors.
"""
return
cache
.
get
(
'configuration-errors'
,
[])
def
get_clean_env
():
"""
Returns cleaned up environment for subprocess execution.
"""
return
{
'HOME'
:
os
.
environ
[
'HOME'
],
'PATH'
:
os
.
environ
[
'PATH'
],
}
weblate/trans/vcs.py
View file @
353cca84
...
...
@@ -22,6 +22,7 @@ Minimal distributed version control system abstraction for Weblate needs.
"""
import
subprocess
from
dateutil
import
parser
from
weblate.trans.util
import
get_clean_env
class
RepositoryException
(
Exception
):
...
...
@@ -63,6 +64,7 @@ class Repository(object):
process
=
subprocess
.
Popen
(
args
,
cwd
=
cwd
,
env
=
get_clean_env
(),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment