lxml.html.iterlinks no longer works with bytestrings in lxml 5.1.0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
scoder |
Bug Description
Python : sys.version_
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)
Minimum example:
import lxml.html
for link in lxml.html.
print(link)
Result with lxml 5.0.1:
(<Element a at 0x7fa4b17fb570>, 'href', 'https:/
Result with lxml 5.1.0:
Traceback (most recent call last):
File "/tmp/test.py", line 2, in <module>
for link in lxml.html.
AttributeError: 'bytes' object has no attribute 'iterlinks'
I suspect this is caused by the replacement of `basestring` with `str` in `_MethodFunc`.
Old: https:/
New: https:/
Some other files (e.g. src/lxml/
Changed in lxml: | |
status: | Fix Committed → Fix Released |
Thanks. This was accidentally lost when modernising the code base after removing Py2 support. /github. com/lxml/ lxml/commit/ 6619dfd4c446b3a 813ab380b22ddd5 83d32b9a29
Fixed in https:/