From a4adf511fc1e275880c7c4bd68c376eab3435437 Mon Sep 17 00:00:00 2001 From: linchiwei123 <40888469+linchiwei123@users.noreply.github.com> Date: Sat, 24 Aug 2019 20:49:00 +0800 Subject: [PATCH] Fix TypeError can only concatenate str (not "bytes") to str --- changelog/5782.bugfix.rst | 1 + src/_pytest/pastebin.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/5782.bugfix.rst diff --git a/changelog/5782.bugfix.rst b/changelog/5782.bugfix.rst new file mode 100644 index 000000000..d1f144b21 --- /dev/null +++ b/changelog/5782.bugfix.rst @@ -0,0 +1 @@ +Fix decoding error when printing an error response from ``--pastebin``. \ No newline at end of file diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py index ce0e73acc..91aa5f1fd 100644 --- a/src/_pytest/pastebin.py +++ b/src/_pytest/pastebin.py @@ -72,7 +72,7 @@ def create_new_paste(contents): if m: return "{}/show/{}".format(url, m.group(1)) else: - return "bad response: " + response + return "bad response: " + response.decode("utf-8") def pytest_terminal_summary(terminalreporter):