mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
win32: force PATH to be non-unicode on win32, if virtualenv munges it
This commit is contained in:
parent
ee863fde59
commit
5b845cbf79
1 changed files with 8 additions and 0 deletions
|
@ -224,6 +224,14 @@ class CommandBase(object):
|
||||||
def build_env(self, gonk=False, hosts_file_path=None):
|
def build_env(self, gonk=False, hosts_file_path=None):
|
||||||
"""Return an extended environment dictionary."""
|
"""Return an extended environment dictionary."""
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
|
if sys.platform == "win32" and type(env['PATH']) == unicode:
|
||||||
|
# On win32, the virtualenv's activate_this.py script sometimes ends up
|
||||||
|
# turning os.environ['PATH'] into a unicode string. This doesn't work
|
||||||
|
# for passing env vars in to a process, so we force it back to ascii.
|
||||||
|
# We don't use UTF8 since that won't be correct anyway; if you actually
|
||||||
|
# have unicode stuff in your path, all this PATH munging would have broken
|
||||||
|
# it in any case.
|
||||||
|
env['PATH'] = env['PATH'].encode('ascii', 'ignore')
|
||||||
extra_path = []
|
extra_path = []
|
||||||
extra_lib = []
|
extra_lib = []
|
||||||
if not self.config["tools"]["system-rust"] \
|
if not self.config["tools"]["system-rust"] \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue