From 45aa75a4ef5426aa4961ee0d6a076c42d6ab0cf1 Mon Sep 17 00:00:00 2001 From: Zsin Skri Date: Mon, 15 Jul 2019 11:39:30 +0200 Subject: [PATCH] document util.command_output return value change After commit `30395911 util.command_output: return stderr, too`, `command_output` returns a tuple of stdout and stderr. Document that change by adding a changelog entry and add a usage note to `command_output`'s docstring. --- beets/util/__init__.py | 3 ++- docs/changelog.rst | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/beets/util/__init__.py b/beets/util/__init__.py index b23832c6d..29b2a73e7 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -805,7 +805,8 @@ CommandOutput = namedtuple("CommandOutput", ("stdout", "stderr")) def command_output(cmd, shell=False): """Runs the command and returns its output after it has exited. - Returns a CommandOutput. + Returns a CommandOutput. The attributes ``stdout`` and ``stderr`` contain + byte strings of the respective output streams. ``cmd`` is a list of arguments starting with the command names. The arguments are bytes on Unix and strings on Windows. diff --git a/docs/changelog.rst b/docs/changelog.rst index c9fbc5fec..e0e19101b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -74,6 +74,9 @@ For plugin developers: is almost identical apart from the name change. Again, we'll re-export at the old location (with a deprecation warning) for backwards compatibility, but might stop doing this in a future release. +* ``beets.util.command_output`` now returns a named tuple of stdout and stderr + instead of only returning stdout. stdout can be accessed as a simple + attribute. For packagers: