We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3eacbc commit a9611baCopy full SHA for a9611ba
src/lxml/html/tests/test_clean.py
@@ -1,5 +1,6 @@
1
import base64
2
import gzip
3
+import io
4
import unittest
5
from lxml.tests.common_imports import make_doctest
6
@@ -188,7 +189,11 @@ def test_sneaky_urls_in_style(self):
188
189
def test_svg_data_links(self):
190
# Remove SVG images with potentially insecure content.
191
svg = b'<svg onload="alert(123)" />'
- svgz = gzip.compress(svg)
192
+ gzout = io.BytesIO()
193
+ f = gzip.GzipFile(fileobj=gzout, mode='wb')
194
+ f.write(svg)
195
+ f.close()
196
+ svgz = gzout.getvalue()
197
svg_b64 = base64.b64encode(svg).decode('ASCII')
198
svgz_b64 = base64.b64encode(svgz).decode('ASCII')
199
urls = [
0 commit comments