mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-05-29 18:22:37 -04:00
Report the lxml bug upstream
This commit is contained in:
@@ -167,7 +167,7 @@ class BuildTest(unittest.TestCase):
|
||||
html.fromstring('<p>\U0001f63a')
|
||||
from calibre.utils.xml_parse import safe_xml_fromstring
|
||||
bad = '\U0001f468' * 8192
|
||||
safe_xml_fromstring(f'<p x="\U0001f600">\U0001f63a😺{bad}</p>')
|
||||
safe_xml_fromstring(f'<p>{bad}</p>')
|
||||
|
||||
def test_certgen(self):
|
||||
from calibre.utils.certgen import create_key_pair
|
||||
|
||||
@@ -30,6 +30,7 @@ def safe_xml_fromstring(string_or_bytes, recover=True):
|
||||
except etree.XMLSyntaxError:
|
||||
# this happens on windows where if string_or_bytes is unicode and
|
||||
# contains non-BMP chars lxml chokes
|
||||
# https://bugs.launchpad.net/lxml/+bug/2125756
|
||||
if sys.platform != 'win32' or not isinstance(string_or_bytes, str):
|
||||
raise
|
||||
ans = fs(string_or_bytes.encode('utf-8'), parser=create_parser(True, encoding='utf-8'))
|
||||
|
||||
Reference in New Issue
Block a user