Encode the environment variables passed to git
Windows allows the environment to have unicode values.
This will cause Python to fail to execute the command.
Change-Id: I37d922c3d7ced0d5b4883f0220346ac42defc5e9
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/subcmds/forall.py b/subcmds/forall.py
index b66313d..8209c80 100644
--- a/subcmds/forall.py
+++ b/subcmds/forall.py
@@ -151,11 +151,11 @@
first = True
for project in self.GetProjects(args):
- env = dict(os.environ.iteritems())
+ env = os.environ.copy()
def setenv(name, val):
if val is None:
val = ''
- env[name] = val
+ env[name] = val.encode()
setenv('REPO_PROJECT', project.name)
setenv('REPO_PATH', project.relpath)