Skip to content
Snippets Groups Projects
Commit 53ac5370 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Print a warning if we have disabled XML comparisons due to a potentially...

Print a warning if we have disabled XML comparisons due to a potentially vulnerable version of pyexpat.
parent 2836c788
No related branches found
No related tags found
No related merge requests found
Pipeline #798350 failed
......@@ -19,6 +19,7 @@
import re
import pyexpat
import logging
from xml.parsers.expat import ExpatError
......@@ -60,6 +61,13 @@ def is_vulnerable_xml_parser():
return pyexpat_version < (2, 6, 0)
logger = logging.getLogger(__name__)
if is_vulnerable_xml_parser():
logger.warning(
"Vulnerable version of pyexpat detected; disabling comparison of XML documents. Install defusedxml or upgrade your pyexpat."
)
def _format(node):
"""
Removes *inplace* spaces from minidom.Document
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment