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

Side by Side Diff: client/trace_inputs.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 unified diff | Download patch
« no previous file with comments | « client/tools/zip_run_isolated.py ('k') | client/utils/oauth.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # coding=utf-8 2 # coding=utf-8
3 # Copyright 2012 The LUCI Authors. All rights reserved. 3 # Copyright 2012 The LUCI Authors. All rights reserved.
4 # Use of this source code is governed under the Apache License, Version 2.0 4 # Use of this source code is governed under the Apache License, Version 2.0
5 # that can be found in the LICENSE file. 5 # that can be found in the LICENSE file.
6 6
7 """Traces an executable and its child processes and extract the files accessed 7 """Traces an executable and its child processes and extract the files accessed
8 by them. 8 by them.
9 9
10 The implementation uses OS-specific API. The native Kernel logger and the ETL 10 The implementation uses OS-specific API. The native Kernel logger and the ETL
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 ## OS-specific imports 47 ## OS-specific imports
48 48
49 if sys.platform == 'win32': 49 if sys.platform == 'win32':
50 from ctypes.wintypes import byref, c_int, c_wchar_p 50 from ctypes.wintypes import byref, c_int, c_wchar_p
51 from ctypes.wintypes import windll # pylint: disable=E0611 51 from ctypes.wintypes import windll # pylint: disable=E0611
52 52
53 53
54 __version__ = '0.2' 54 __version__ = '0.2'
55 55
56 56
57 BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 57 BASE_DIR = os.path.dirname(os.path.abspath(
58 __file__.decode(sys.getfilesystemencoding())))
58 ROOT_DIR = os.path.dirname(os.path.dirname(BASE_DIR)) 59 ROOT_DIR = os.path.dirname(os.path.dirname(BASE_DIR))
59 60
60 61
61 class TracingFailure(Exception): 62 class TracingFailure(Exception):
62 """An exception occured during tracing.""" 63 """An exception occured during tracing."""
63 def __init__(self, description, pid, line_number, line, *args): 64 def __init__(self, description, pid, line_number, line, *args):
64 super(TracingFailure, self).__init__( 65 super(TracingFailure, self).__init__(
65 description, pid, line_number, line, *args) 66 description, pid, line_number, line, *args)
66 self.description = description 67 self.description = description
67 self.pid = pid 68 self.pid = pid
(...skipping 3328 matching lines...) Expand 10 before | Expand all | Expand 10 after
3396 sys.stderr.write('\n') 3397 sys.stderr.write('\n')
3397 return 1 3398 return 1
3398 3399
3399 3400
3400 if __name__ == '__main__': 3401 if __name__ == '__main__':
3401 subprocess42.inhibit_os_error_reporting() 3402 subprocess42.inhibit_os_error_reporting()
3402 fix_encoding.fix_encoding() 3403 fix_encoding.fix_encoding()
3403 tools.disable_buffering() 3404 tools.disable_buffering()
3404 colorama.init() 3405 colorama.init()
3405 sys.exit(main(sys.argv[1:])) 3406 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « client/tools/zip_run_isolated.py ('k') | client/utils/oauth.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698