bug 1124192 - Fix PATH winding up as unicode when using activate_virtualenv. r=gps
authorTed Mielczarek <ted@mielczarek.org>
Mon, 26 Jan 2015 13:43:01 -0500
changeset 225693 8c25582fc7768c0bd5a03f56fe2dac0460a4d0a0
parent 225692 d91343f88f114f61828cf22c72e17633fdaf4f46
child 225694 211567afcc5ffee39ca776fdb95269d14191a889
child 225838 a6f037b538edf7bf154129fe124e81b920eb805f
push id54658
push usertmielczarek@mozilla.com
push dateMon, 26 Jan 2015 18:43:39 +0000
treeherdermozilla-inbound@8c25582fc776 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1124192
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1124192 - Fix PATH winding up as unicode when using activate_virtualenv. r=gps
python/mozbuild/mozbuild/virtualenv.py
--- a/python/mozbuild/mozbuild/virtualenv.py
+++ b/python/mozbuild/mozbuild/virtualenv.py
@@ -390,16 +390,18 @@ class VirtualenvManager(object):
         """Activate the virtualenv in this Python context.
 
         If you run a random Python script and wish to "activate" the
         virtualenv, you can simply instantiate an instance of this class
         and call .ensure() and .activate() to make the virtualenv active.
         """
 
         execfile(self.activate_path, dict(__file__=self.activate_path))
+        if isinstance(os.environ['PATH'], unicode):
+            os.environ['PATH'] = os.environ['PATH'].encode('utf-8')
 
     def install_pip_package(self, package):
         """Install a package via pip.
 
         The supplied package is specified using a pip requirement specifier.
         e.g. 'foo' or 'foo==1.0'.
 
         If the package is already installed, this is a no-op.