servo: Merge #10003 - Patch handles exception with errormessage on topdir with Unicode characters (from qaxi:master); r=metajack

https://github.com/servo/servo/issues/10002
./mach does not support paths with Unicode characters for now

it fail on original line 154 with exception UnicodeDecodeError
This patch handles the exception

Source-Repo: https://github.com/servo/servo
Source-Revision: 42c7472f336e687200507dafdf1087d8f0ea4d55
This commit is contained in:
Petr Klíma 2016-03-17 00:16:22 +05:01
parent e84cd4ad5f
commit 907e9fec6f

View File

@ -149,6 +149,15 @@ def _activate_virtualenv(topdir):
def bootstrap(topdir):
topdir = os.path.abspath(topdir)
# We don't support paths with Unicode characters for now
# https://github.com/servo/servo/issues/10002
try:
topdir.decode('ascii')
except UnicodeDecodeError:
print('Cannot run mach in a path with Unicode characters.')
print('Current path:', topdir)
sys.exit(1)
# We don't support paths with spaces for now
# https://github.com/servo/servo/issues/9442
if ' ' in topdir: