Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: client/run_isolated.py

Issue 2093593002: luci-py: Making __file__ usage unicode safe. (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Small fixes. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/libs/logdog/tests/varint_test.py ('k') | client/swarming.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/run_isolated.py
diff --git a/client/run_isolated.py b/client/run_isolated.py
index cbfae61721827bdd85c5c9a160ae6949238df942..263ffbf36587ca5da457f1ba1dd3f9d4e6855bf2 100755
--- a/client/run_isolated.py
+++ b/client/run_isolated.py
@@ -58,10 +58,12 @@ EXECUTABLE_SUFFIX_PARAMETER = '${EXECUTABLE_SUFFIX}'
SWARMING_BOT_FILE_PARAMETER = '${SWARMING_BOT_FILE}'
# Absolute path to this file (can be None if running from zip on Mac).
-THIS_FILE_PATH = os.path.abspath(__file__) if __file__ else None
+THIS_FILE_PATH = os.path.abspath(
+ __file__.decode(sys.getfilesystemencoding())) if __file__ else None
# Directory that contains this file (might be inside zip package).
-BASE_DIR = os.path.dirname(THIS_FILE_PATH) if __file__ else None
+BASE_DIR = os.path.dirname(THIS_FILE_PATH) if __file__.decode(
+ sys.getfilesystemencoding()) else None
# Directory that contains currently running script file.
if zip_package.get_main_script_path():
@@ -193,11 +195,11 @@ def run_command(command, cwd, tmp_dir, hard_timeout, grace_period):
env = os.environ.copy()
if sys.platform == 'darwin':
- env['TMPDIR'] = tmp_dir.encode('ascii')
+ env['TMPDIR'] = tmp_dir.encode(sys.getfilesystemencoding())
elif sys.platform == 'win32':
- env['TEMP'] = tmp_dir.encode('ascii')
+ env['TEMP'] = tmp_dir.encode(sys.getfilesystemencoding())
else:
- env['TMP'] = tmp_dir.encode('ascii')
+ env['TMP'] = tmp_dir.encode(sys.getfilesystemencoding())
exit_code = None
had_hard_timeout = False
with tools.Profiler('RunTest'):
« no previous file with comments | « client/libs/logdog/tests/varint_test.py ('k') | client/swarming.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698