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

Unified Diff: appengine/swarming/local_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/components/tool_support/local_app.py ('k') | appengine/swarming/remote_smoke_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/local_smoke_test.py
diff --git a/appengine/swarming/local_smoke_test.py b/appengine/swarming/local_smoke_test.py
index 35c6759168fdcc35c7b0b8ffa2aa25fcce13ef9a..09e019d8efa098f39246b31efe4fb6172fcce9ba 100755
--- a/appengine/swarming/local_smoke_test.py
+++ b/appengine/swarming/local_smoke_test.py
@@ -13,7 +13,6 @@ import json
import glob
import logging
import os
-import shutil
import signal
import socket
import sys
@@ -30,6 +29,8 @@ from tools import start_bot
from tools import start_servers
sys.path.insert(0, CLIENT_DIR)
+from third_party.depot_tools import fix_encoding
+from utils import file_path
from utils import subprocess42
sys.path.pop(0)
@@ -167,7 +168,7 @@ class SwarmingClient(object):
outputs[name] = f.read()
return summary, outputs
finally:
- shutil.rmtree(tmpdir)
+ file_path.rmtree(tmpdir)
finally:
os.remove(tmp)
@@ -176,7 +177,7 @@ class SwarmingClient(object):
def cleanup(self):
if self._tmpdir:
- shutil.rmtree(self._tmpdir)
+ file_path.rmtree(self._tmpdir)
self._tmpdir = None
def dump_log(self):
@@ -470,7 +471,7 @@ class Test(unittest.TestCase):
actual_files.pop('summary.json')
self.assertEqual(expected_files, actual_files)
finally:
- shutil.rmtree(tmpdir)
+ file_path.rmtree(tmpdir)
def assertResults(self, expected, result):
self.assertEqual(['shards'], result.keys())
@@ -524,6 +525,7 @@ def cleanup(bot, client, servers, print_all, leak):
def main():
+ fix_encoding.fix_encoding()
verbose = '-v' in sys.argv
leak = bool('--leak' in sys.argv)
if leak:
« no previous file with comments | « appengine/components/tool_support/local_app.py ('k') | appengine/swarming/remote_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698