Parsing files when standalone="yes"

Bug #2052935 reported by Charlie_X
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Fix Released
Medium
scoder

Bug Description

```python
from lxml.etree import fromstring

src = """
<?xml version="1.0" standalone="yes"?>
<externalLink xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <oleLink xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId1" progId="Word.Document.12">
    <oleItems>
      <oleItem name="!OLE_LINK1" advise="1" preferPic="1"/>
    </oleItems>
  </oleLink>
</externalLink>
"""

xml = fromstring(src)
 File "<string>", line 1, in ?
lxml.etree.XMLSyntaxError: Blank needed here, line 1, column 21 (<string>, line 1)
```

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

I've seen this reported for python-docx and it seems to be related to changes in libXML2. But as I couldn't find anything here I'm submiting this report.

Revision history for this message
scoder (scoder) wrote :

This seems to have been fixed in libxml2 2.12.4:
https://gitlab.gnome.org/GNOME/libxml2/-/commit/1e6b17b8348f9b8d485febaf410d2c419d254924

I'll see that I use at least 2.12.5 in the wheels of the next release.

Changed in lxml:
milestone: none → 5.1.1
assignee: nobody → scoder (scoder)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Charlie_X (charlie) wrote :

Thanks for the quick reply. Great news, I can look forward to tests no longer failing soon.
Seem to remember a similar regression in libxml2 a couple of years ago.

scoder (scoder)
Changed in lxml:
status: Confirmed → Fix Released
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.