This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb3b517d57239: [lldb] Explicitly open file to write with utf-8 encoding in crashlog.py (authored by augusto2112).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136798/new/ https://reviews.llvm.org/D136798 Files: lldb/examples/python/crashlog.py Index: lldb/examples/python/crashlog.py =================================================================== --- lldb/examples/python/crashlog.py +++ lldb/examples/python/crashlog.py @@ -449,7 +449,7 @@ head, _, tail = buffer.partition('\n') return json.loads(tail) - with open(path, 'r') as f: + with open(path, 'r', encoding='utf-8') as f: buffer = f.read() try: return parse_json(buffer) @@ -644,7 +644,7 @@ } def parse(self): - with open(self.path,'r') as f: + with open(self.path,'r', encoding='utf-8') as f: lines = f.read().splitlines() for line in lines: @@ -865,7 +865,7 @@ result.PutCString( "error: invalid arguments, a single output file is the only valid argument") return - out_file = open(args[0], 'w') + out_file = open(args[0], 'w', encoding='utf-8') if not out_file: result.PutCString( "error: failed to open file '%s' for writing...",
Index: lldb/examples/python/crashlog.py =================================================================== --- lldb/examples/python/crashlog.py +++ lldb/examples/python/crashlog.py @@ -449,7 +449,7 @@ head, _, tail = buffer.partition('\n') return json.loads(tail) - with open(path, 'r') as f: + with open(path, 'r', encoding='utf-8') as f: buffer = f.read() try: return parse_json(buffer) @@ -644,7 +644,7 @@ } def parse(self): - with open(self.path,'r') as f: + with open(self.path,'r', encoding='utf-8') as f: lines = f.read().splitlines() for line in lines: @@ -865,7 +865,7 @@ result.PutCString( "error: invalid arguments, a single output file is the only valid argument") return - out_file = open(args[0], 'w') + out_file = open(args[0], 'w', encoding='utf-8') if not out_file: result.PutCString( "error: failed to open file '%s' for writing...",
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits