Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/16966 )
Change subject: IMPALA-10447: Add a newline when exporting shell output to a file. ...................................................................... Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/16966/1/shell/shell_output.py File shell/shell_output.py: http://gerrit.cloudera.org:8080/#/c/16966/1/shell/shell_output.py@120 PS1, Line 120: '\n' This should be b'\n'. Python3 requires this arg be in 'bytes' instead of 'str' since we open the file using binary mode ('b'). $ python3 Python 3.7.5 (default, Nov 1 2019, 02:16:32) [Clang 11.0.0 (clang-1100.0.33.8)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> with open('/tmp/my.txt', 'ab') as out_file: ... out_file.write('\n') ... Traceback (most recent call last): File "<stdin>", line 2, in <module> TypeError: a bytes-like object is required, not 'str' >>> with open('/tmp/my.txt', 'ab') as out_file: ... out_file.write(b'\n') ... 1 >>> -- To view, visit http://gerrit.cloudera.org:8080/16966 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I078a06c54e0834bc1f898626afbfff4ded579fa9 Gerrit-Change-Number: 16966 Gerrit-PatchSet: 1 Gerrit-Owner: Andrew Sherman <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Comment-Date: Fri, 22 Jan 2021 08:58:22 +0000 Gerrit-HasComments: Yes
