-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent failure in /url/percent-encoding.window.html #27737
Comments
This result isn't actually intermittent, but it only happens when running the test under python3:
|
I can reproduce the issue on my computer (Debian, python 3.8). To fix the problem i had to change the script def numeric_references(input):
output = b""
for cp in input:
output += b"&#x" + format(ord(cp), "X").encode('ascii') + b";"
return output
def main(request, response):
# Undo the "magic" space with + replacement as otherwise base64 decoding will fail.
value = request.GET.first(b"value").replace(b" ", b"+")
encoding = request.GET.first(b"encoding")
output_value = numeric_references(base64.b64decode(value).decode("utf-8"))
return (
[(b"Content-Type", b"text/html;charset=" + encoding)],
b"""<!doctype html>
<a href="https://doesnotmatter.invalid/?%s#%s">test</a>
""" % (output_value, output_value)) The 3 modified lines are:
I have issues to run WPT with Python 2 on my computer, so i cant check the compatibility of these changes. |
This bug was fixed upstream in web-platform-tests/wpt#26643, which got merged into servo in #27736. |
Thanks! |
The text was updated successfully, but these errors were encountered: