Skip to content

Commit 2ac73d7

Browse files
authored
fix(cli: don't swallow command output in renku run (#3508)
1 parent 80f0268 commit 2ac73d7

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

renku/core/workflow/run.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import os
2020
import sys
2121
from collections import defaultdict
22+
from io import UnsupportedOperation
2223
from pathlib import Path
2324
from subprocess import call
2425
from typing import Dict, List, NamedTuple, Optional, Set, Union, cast
@@ -291,6 +292,24 @@ def parse_explicit_definition(entries, type):
291292
if stderr_redirected:
292293
sys.stderr = old_stderr
293294

295+
if "stdout" not in mapped_std:
296+
try:
297+
sys.stdout.fileno()
298+
except UnsupportedOperation:
299+
# Pytest capsys creates a pseudo device that doesn't have fileno and would fail if passed
300+
pass
301+
else:
302+
mapped_std["stdout"] = sys.stdout
303+
304+
if "stderr" not in mapped_std:
305+
try:
306+
sys.stderr.fileno()
307+
except UnsupportedOperation:
308+
# Pytest capsys creates a pseudo device that doesn't have fileno and would fail if passed
309+
pass
310+
else:
311+
mapped_std["stderr"] = sys.stderr
312+
294313
started_at_time = local_now()
295314

296315
try:

0 commit comments

Comments
 (0)