From 40f4e9af4c114d64deb85f2584043b2aa406b2fa Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 26 Oct 2018 19:18:33 +0200 Subject: [PATCH] Remove query strings from file:// URIs Fix #687, fix #688. --- weasyprint/tests/test_api.py | 5 ++++- weasyprint/urls.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/weasyprint/tests/test_api.py b/weasyprint/tests/test_api.py index a51704b7..08953aed 100644 --- a/weasyprint/tests/test_api.py +++ b/weasyprint/tests/test_api.py @@ -799,7 +799,8 @@ uses_relative.append('weasyprint-custom') @assert_no_logs def test_url_fetcher(): - with open(resource_filename('pattern.png'), 'rb') as pattern_fd: + filename = resource_filename('pattern.png') + with open(filename, 'rb') as pattern_fd: pattern_png = pattern_fd.read() def fetcher(url): @@ -822,6 +823,8 @@ def test_url_fetcher(): check_png_pattern(html.write_png(stylesheets=[css]), blank=blank) test('') # Test a "normal" URL + test('' % Path(filename).as_uri()) + test('' % Path(filename).as_uri()) test('') test('') test('