diff --git a/CHANGELOG.md b/CHANGELOG.md index 35cc03959..5f5b1db32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ - The new jupyterlab extension (in version 1.2.0) is compatible with JupyterLab 2.0. Many thanks to Jean Helie! (#449) - It is not compatible with JupyterLab 1.x anymore. If you wish, you can install manually the previous version of the extension with `jupyter labextension install jupyterlab-jupytext@1.1.1`. +**Fixed** +- Display the output/errors of command executed with `jupytext --pipe` or `jupytext --check` (#432) 1.3.5 (2020-03-08) ------------------ diff --git a/jupytext/cli.py b/jupytext/cli.py index e1bbac6fa..e9fe50323 100644 --- a/jupytext/cli.py +++ b/jupytext/cli.py @@ -625,13 +625,18 @@ def exec_command(command, input=None): """Execute the desired command, and pipe the given input into it""" if not isinstance(command, list): command = command.split(' ') + sys.stdout.write("[jupytext] Executing {}\n".format(' '.join(command))) process = subprocess.Popen(command, **(dict(stdout=subprocess.PIPE, stdin=subprocess.PIPE) if input is not None else {})) out, err = process.communicate(input=input) + if out: + sys.stdout.write(out.decode('utf-8')) + if err: + sys.stderr.write(err.decode('utf-8')) if process.returncode: - sys.stderr.write("The command {} exited with code {}{}" - .format(command, process.returncode, ': {}'.format(err or out) if err or out else '')) + sys.stderr.write("[jupytext] Error: The command '{}' exited with code {}\n" + .format(' '.join(command), process.returncode)) raise SystemExit(process.returncode) return out