Change of behaviour for itertext() method

Bug #1844674 reported by Omer Nawaz on 2019-09-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Medium
scoder

Bug Description

I see a change of behavior for method itertext() moving to the newer version of lxml "4.4.1" from "4.3.5"

from lxml import html
div = html.fromstring('<div attrib1="" class="key-value__key key-value__key--compact"><!----> Some Text </div>')
print(div.text) # Output: None
[x for x in div.itertext()] # Output: ['', ' Some Text ']

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

------------------------------------------------------------------------

from lxml import html
div = html.fromstring('<div attrib1="" class="key-value__key key-value__key--compact"><!----> Some Text </div>')
print(div.text) # Output: None
[x for x in div.itertext()] # Output: []

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

scoder (scoder) wrote :
Changed in lxml:
assignee: nobody → scoder (scoder)
importance: Undecided → Medium
status: New → Fix Committed
milestone: none → 4.4.3
scoder (scoder) on 2020-02-25
Changed in lxml:
milestone: 4.4.3 → none
status: Fix Committed → Fix Released
milestone: none → 4.4.3
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers