Tim Armstrong has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/9928


Change subject: IMPALA-2717: fix output of formatted unicode to non-TTY
......................................................................

IMPALA-2717: fix output of formatted unicode to non-TTY

The bug is that PrettyOutputFormatter.format() returned a unicode
object, and Python cannot automatically write unicode objects to
output streams where there is no default encoding.

The fix is to convert to UTF-8 encoded in a regular string, which
can be output to any output device. This makes the output type
consistent with DelimitedOutputFormatter.format().

Based on code by Marcell Szabo.

Testing:
Added a basic test.

Played around in an interactive shell to make sure that unicode
characters still work in interactive mode.

Change-Id: I9de641ecf767a2feef3b9f48b344ef2d55e17a7f
---
M shell/shell_output.py
M tests/shell/test_shell_commandline.py
2 files changed, 16 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/28/9928/1
--
To view, visit http://gerrit.cloudera.org:8080/9928
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9de641ecf767a2feef3b9f48b344ef2d55e17a7f
Gerrit-Change-Number: 9928
Gerrit-PatchSet: 1
Gerrit-Owner: Tim Armstrong <tarmstr...@cloudera.com>

Reply via email to