diff --git a/testing/web-platform/tests/.well-known/origin-policy b/testing/web-platform/tests/.well-known/origin-policy index d0de31e693cb..2f0e9d0525ac 100644 --- a/testing/web-platform/tests/.well-known/origin-policy +++ b/testing/web-platform/tests/.well-known/origin-policy @@ -35,6 +35,6 @@ def main(request, response): if len(matches) != 1: return 404, [], '{} origin policies found at a path matching "{}"'.format(len(matches), filepath_pattern) - with open(matches[0]) as f: + with open(matches[0], 'rb') as f: data = f.read() return return_code, [('Content-Type', content_type)], data diff --git a/testing/web-platform/tests/cookies/resources/cookie.py b/testing/web-platform/tests/cookies/resources/cookie.py index d6cff8796583..63eedf0b01ef 100644 --- a/testing/web-platform/tests/cookies/resources/cookie.py +++ b/testing/web-platform/tests/cookies/resources/cookie.py @@ -21,7 +21,7 @@ def main(request, response): try: if b'drop' in request.GET: cookie = request.GET[b'drop'] - cookie += b"; max-age=0" + cookie += b'; max-age=0' if b'set' in request.GET: cookie = request.GET[b'set'] diff --git a/testing/web-platform/tests/fetch/metadata/resources/post-to-owner.py b/testing/web-platform/tests/fetch/metadata/resources/post-to-owner.py index 4890c49acbdf..256dd6e49dcc 100644 --- a/testing/web-platform/tests/fetch/metadata/resources/post-to-owner.py +++ b/testing/web-platform/tests/fetch/metadata/resources/post-to-owner.py @@ -9,6 +9,10 @@ def main(request, response): ] key = request.GET.first(b"key", None) + # We serialize the key into JSON, so have to decode it first. + if key is not None: + key = key.decode('utf-8') + body = u""" diff --git a/testing/web-platform/tests/xhr/resources/auth5/auth.py b/testing/web-platform/tests/xhr/resources/auth5/auth.py index e18319e3de8e..43b376e6e87a 100644 --- a/testing/web-platform/tests/xhr/resources/auth5/auth.py +++ b/testing/web-platform/tests/xhr/resources/auth5/auth.py @@ -10,6 +10,6 @@ def main(request, response): response.headers.set(b'WWW-Authenticate', b'Basic realm="test"') content = b'User name/password wrong or not given: ' - content += b"%s\n%s" % (request.auth.username, - request.auth.password) + content += b"%s\n%s" % (request.auth.username or b'', + request.auth.password or b'') return content