GitHub user sctincman opened a pull request: https://github.com/apache/zeppelin/pull/2555
[ZEPPELIN-2885] Have Logger subclass StringIO and override write method ### What is this PR for? H2O python module uses the `isatty` method when outputting to stdout. As Zeppelin replaces stdout with a custom Logger class, the lack of this method causes H2O to fail with most operations. Subclassing StringIO and overriding the write method fixes this ensures other behavior in the TextIO classes used for stdout is present as well, obviating the need to keep adding method stubs to workaround other modules in the future. ### What type of PR is it? [Bug Fix] ### Todos * [ ] - Does `reset` still need to be present? ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-2885 ### How should this be tested? * Python/Pyspark interpreter output still works * Running the following paragraph should return `False` ``` %python import sys sys.stdout.isatty() ``` ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No You can merge this pull request into a Git repository by running: $ git pull https://github.com/sctincman/zeppelin master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/2555.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2555 ---- commit 128bdb77c9c453bd10c9d7f6e7b87c21b231fddd Author: Jonathan Tinkham <jonathantink...@fico.com> Date: 2017-08-28T18:34:08Z [ZEPPELIN-2885] Have Logger subclass StringIO and override write method H2O python module uses the `isatty` method when outputting to stdout. As Zeppelin replaces stdout with a custom Logger class, the lack of this method causes H2O to fail with most operations. Subclassing StringIO and overriding the write method fixes this ensures other behavior in the TextIO classes used for stdout is present as well, obviating the need to keep adding method stubs to workaround other modules in the future. [Bug Fix] * [ ] - Does `reset` still need to be present? * https://issues.apache.org/jira/browse/ZEPPELIN-2885 * Python/Pyspark interpreter output still works * Running the following paragraph should return `False` ``` %python import sys sys.stdout.isatty() ``` * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---