strip_attributes not working with wildcard

Bug #1846267 reported by Iulian Onofrei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Triaged
Wishlist
Unassigned

Bug Description

from lxml import etree, html

b = html.fromstring('<b attribute-1="1" attribute-2="2">Text</b>')

etree.strip_attributes(b, '*')

print(etree.tostring(b).decode())

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

Revision history for this message
Iulian Onofrei (revolteh) wrote :
Revision history for this message
scoder (scoder) wrote :

Yes, sounds like a reasonable feature.
PR welcome.

description: updated
Changed in lxml:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Iulian Onofrei (revolteh) wrote :

Isn't it a bug, not a feature? Because from the documentation (https://lxml.de/api/lxml.etree-module.html#strip_attributes) it sounds like it should have already worked.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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