Incorrect parsing after importing xmlsec

Bug #1887848 reported by Oleg Hoefling
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lxml
New
Undecided
Unassigned

Bug Description

This is a follow-up of https://bugs.launchpad.net/lxml/+bug/1880251 (fixed in 4.5.2). I'm extracting the comment https://bugs.launchpad.net/lxml/+bug/1880251/comments/3 to a separate issue:

### Version info

Python : sys.version_info(major=3, minor=8, micro=3, releaselevel='final', serial=0)
lxml.etree : (4, 5, 2, 0)
libxml used : (2, 9, 10)
libxml compiled : (2, 9, 10)
libxslt used : (1, 1, 34)
libxslt compiled : (1, 1, 34)

### Summary

The description is the same as in https://bugs.launchpad.net/lxml/+bug/1880251, besides that the LXML import now occurs after the xmlsec1 library load:

```python
import ctypes

xmlsec = ctypes.CDLL('/usr/lib/libxmlsec1.so')
xmlsec.xmlSecInit()

from lxml import etree

etree.parse('doc.xml')
etree.parse('doc.xml')
```

yields

```
Traceback (most recent call last):
  File "reader.py", line 23, in <module>
    etree.parse('doc.xml')
  File "src/lxml/etree.pyx", line 3467, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1839, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1865, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1769, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1163, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 651, in lxml.etree._raiseParseError
  File "b'doc.xml'", line 0
lxml.etree.XMLSyntaxError
```

Revision history for this message
scoder (scoder) wrote :

Closing this as a duplicate of a more general bug.

summary: - Reusing the default XML parser raises an XMLSyntaxError, part II
+ Incorrect parsing after importing xmlsec
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.