Serhiy Storchaka added the comment:
Fixed by issue39822. e.attrib = 1 now raises a TypeError.
--
resolution: -> out of date
stage: needs patch -> resolved
status: open -> closed
versions: -Python 2.7, Python 3.7, Python 3.8
___
Python tracker
Stefan Behnel added the comment:
I agree that SystemError is the wrong response. Whether it needs to be
AttributeError – probably fine to consider this an implementation detail.
TypeError also seems ok in at least some of the cases. I think we should widen
the code to expect some kind of Mapp
New submission from Serhiy Storchaka :
The C implementation raises a SystemError after setting Element.attrib to
non-dict.
>>> from xml.etree import ElementTree as ET
>>> e = ET.Element('a')
>>> e.attrib = 1
>>> e.get('x')
Traceback (most recent call last):
File "", line 1, in
SystemError: