zjw1111 commented on code in PR #181:
URL: https://github.com/apache/paimon-cpp/pull/181#discussion_r3719779760


##########
build_support/asan_symbolize.py:
##########
@@ -333,8 +334,17 @@ def process_stdin(self):
     if sys.version_info[0] == 2:
       sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
     else:
-      # Unbuffered output is not supported in Python 3
-      sys.stdout = os.fdopen(sys.stdout.fileno(), 'w')
+      # Test output is not guaranteed to be valid UTF-8, so pin both streams 
to the same
+      # encoding and round such bytes through surrogateescape, which passes 
them out
+      # unchanged instead of raising and truncating the rest of the test log. 
Both the
+      # encoding and the error handler have to be set on both streams: taking 
either from
+      # the locale or from PYTHONIOENCODING would let them disagree and 
re-encode the bytes.
+      # The buffers are rewrapped rather than reconfigured, which needs Python 
3.7, and
+      # line buffering stands in for the unbuffered output Python 3 does not 
support.
+      sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8',

Review Comment:
   maybe we need append a ASF license for this file, because this file is 
modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to