From 6efe02959db5f1aa36cc930039272ac3e1c4612a Mon Sep 17 00:00:00 2001 From: Martin Di Paola Date: Thu, 24 Feb 2022 22:53:32 +0000 Subject: [PATCH] Capture stderr because some runners print their version there --- byexample/runner.py | 5 ++++- docs/overview/faq.md | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/byexample/runner.py b/byexample/runner.py index 03d50168..b4e6b3c0 100644 --- a/byexample/runner.py +++ b/byexample/runner.py @@ -969,7 +969,10 @@ def _get_version(self, options): return None try: - out = subprocess.check_output(cmd).decode(self.encoding) + out = subprocess.check_output(cmd, + stderr=subprocess.STDOUT).decode( + self.encoding + ) version = self._parse_version(out) except Exception as err: diff --git a/docs/overview/faq.md b/docs/overview/faq.md index d30daa96..d0d2c417 100644 --- a/docs/overview/faq.md +++ b/docs/overview/faq.md @@ -216,10 +216,9 @@ If you want to know the exact command line used by `byexample`, you can find it adding more verbosity: ```shell -$ byexample -l python -x-shebang 'python:env python99' -v test/ds/db-stock-model # byexample: +norm-ws +$ byexample -l python -x-shebang 'python:env python99' -v test/ds/db-stock-model # byexample: +norm-ws +diff=ndiff [i] Initializing Python Runner [i] Spawn command line: env python99 -<...> [w] Failed to obtain Python Runner's version <...> [w] Initialization of Python Runner failed. <...>