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

Unified Diff: client/tests/run_isolated_smoke_test.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/tests/on_error_test.py ('k') | client/tests/run_isolated_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/run_isolated_smoke_test.py
diff --git a/client/tests/run_isolated_smoke_test.py b/client/tests/run_isolated_smoke_test.py
index c2831136ac0bd174db93ed9ed641fd85c9c271e9..70e30b314eb6085478db3f4be6426d27aa12ed26 100755
--- a/client/tests/run_isolated_smoke_test.py
+++ b/client/tests/run_isolated_smoke_test.py
@@ -10,7 +10,8 @@ import subprocess
import sys
import unittest
-ROOT_DIR = unicode(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(
+ __file__.decode(sys.getfilesystemencoding()))))
sys.path.insert(0, ROOT_DIR)
import isolated_format
@@ -25,7 +26,8 @@ import test_utils
CONTENTS = {
'check_files.py': """if True:
import os, sys
- ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
+ ROOT_DIR = os.path.dirname(os.path.abspath(
+ __file__.decode(sys.getfilesystemencoding())))
expected = [
'check_files.py', 'file1.txt', 'file1_copy.txt', 'file2.txt',
'repeated_files.py',
@@ -47,7 +49,8 @@ CONTENTS = {
'repeated_files.py': """if True:
import os, sys
expected = ['file1.txt', 'file1_copy.txt', 'repeated_files.py']
- actual = sorted(os.listdir(os.path.dirname(os.path.abspath(__file__))))
+ actual = sorted(os.listdir(os.path.dirname(os.path.abspath(
+ __file__.decode(sys.getfilesystemencoding())))))
if expected != actual:
print >> sys.stderr, 'Expected list doesn\\'t match:'
print >> sys.stderr, '%s\\n%s' % (','.join(expected), ','.join(actual))
@@ -56,7 +59,8 @@ CONTENTS = {
'max_path.py': """if True:
import os, sys
prefix = u'\\\\\\\\?\\\\' if sys.platform == 'win32' else u''
- path = unicode(os.path.join(os.getcwd(), 'a' * 200, 'b' * 200))
+ path = os.path.join(os.getcwd().decode(
+ sys.getfilesystemencoding()), 'a' * 200, 'b' * 200)
with open(prefix + path, 'rb') as f:
actual = f.read()
if actual != 'File1\\n':
« no previous file with comments | « client/tests/on_error_test.py ('k') | client/tests/run_isolated_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698