We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 626ec68 commit 8af6c20Copy full SHA for 8af6c20
scripts/xcresult_logs.py
@@ -64,7 +64,17 @@ def main():
64
# but also makes it harder to deal with.
65
log_id = find_log_id(xcresult_path)
66
log = export_log(xcresult_path, log_id)
67
- sys.stdout.write(log)
+
68
+ # Avoid a potential UnicodeEncodeError raised by sys.stdout.write() by
69
+ # doing a relaxed encoding ourselves.
70
+ if hasattr(sys.stdout, 'buffer'):
71
+ log_encoded = log.encode('utf8', errors='backslashreplace')
72
+ sys.stdout.flush()
73
+ sys.stdout.buffer.write(log_encoded)
74
+ else:
75
+ log_encoded = log.encode('ascii', errors='backslashreplace')
76
+ log_decoded = log_encoded.decode('ascii', errors='strict')
77
+ sys.stdout.write(log_decoded)
78
79
80
# Most flags on the xcodebuild command-line are uninteresting, so only pull
0 commit comments