Ema has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/403671 )
Change subject: Alerts instrumentation: return instance of bytes ...................................................................... Alerts instrumentation: return instance of bytes Twisted returns a 500 if the returned body is not an instance of 'bytes'. 'unicode' values are not. Make sure we return a value of type 'str' instead. Bug: T184721 Ref: https://github.com/twisted/twisted/blob/8857cbf4ec6a88b6cfb758ccaa9161d6b2f48009/src/twisted/web/server.py#L314 Change-Id: I23aa6f24ed729487621fe61625d86600d8c25b03 (cherry picked from commit 3505626c9d1590e84525560edbc2f5bf01a7be99) --- M pybal/instrumentation.py 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Ema: Looks good to me, approved jenkins-bot: Verified diff --git a/pybal/instrumentation.py b/pybal/instrumentation.py index 386b174..64437e8 100644 --- a/pybal/instrumentation.py +++ b/pybal/instrumentation.py @@ -90,7 +90,10 @@ if wantJson(request): return json.dumps(resp) else: - return "%s - %s" % (resp['status'].upper(), resp['msg']) + # Twisted returns a 500 if the returned body is not an instance of + # 'bytes'. 'unicode' values are not. Make sure we return a 'str' + # instead. See https://phabricator.wikimedia.org/T184721 + return str("%s - %s" % (resp['status'].upper(), resp['msg'])) class PoolsRoot(Resource): """Pools base resource. -- To view, visit https://gerrit.wikimedia.org/r/403671 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I23aa6f24ed729487621fe61625d86600d8c25b03 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/pybal Gerrit-Branch: 1.14 Gerrit-Owner: Ema <[email protected]> Gerrit-Reviewer: Ema <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
