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

Unified Diff: appengine/swarming/remote_smoke_test.py

Issue 1390773002: Add an assert to ensure UTF-8 locale when handling file paths. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: More fixes Created 5 years, 2 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 | « appengine/swarming/local_smoke_test.py ('k') | appengine/swarming/server/bot_code_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/remote_smoke_test.py
diff --git a/appengine/swarming/remote_smoke_test.py b/appengine/swarming/remote_smoke_test.py
index 70ea38c21ac89b1804d59351bd0c9842ff5f42a9..119454ca0012be8b2e21217bb63fa8e26a22d415 100755
--- a/appengine/swarming/remote_smoke_test.py
+++ b/appengine/swarming/remote_smoke_test.py
@@ -10,7 +10,6 @@ import json
import logging
import optparse
import os
-import shutil
import subprocess
import sys
import tempfile
@@ -22,6 +21,11 @@ CHECKOUT_DIR = os.path.dirname(os.path.dirname(APP_DIR))
CLIENT_DIR = os.path.join(CHECKOUT_DIR, 'client')
SWARMING_SCRIPT = os.path.join(CLIENT_DIR, 'swarming.py')
+sys.path.insert(0, CLIENT_DIR)
+from third_party.depot_tools import fix_encoding
+from utils import file_path
+sys.path.pop(0)
+
def gen_isolated(isolate, script, includes=None):
"""Archives a script to `isolate` server."""
@@ -61,7 +65,7 @@ def gen_isolated(isolate, script, includes=None):
out = subprocess.check_output(cmd)
return out.split(' ', 1)[0]
finally:
- shutil.rmtree(tmp)
+ file_path.rmtree(tmp)
def capture(cmd, **kwargs):
@@ -193,6 +197,7 @@ def run_test(results, swarming, isolate, extra_flags, name, test_case):
def main():
+ fix_encoding.fix_encoding()
# It's necessary for relative paths in .isolate.
os.chdir(APP_DIR)
« no previous file with comments | « appengine/swarming/local_smoke_test.py ('k') | appengine/swarming/server/bot_code_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698