Irit Katriel <iritkatr...@gmail.com> added the comment:

This is a bug in elementtree - the caller should own a reference to the dict 
during the entire PyDict_GetItem call.

We won't add the refcount change you propose because it's not free and this is 
a hot function. 

The test in your patch doesn't fail for me (I tried on version 3.11 on a Mac). 
Are you still seeing the problem on version >= 3.9, or perhaps it was fixed in 
eaementtree by now?

----------
nosy: +iritkatriel
title: issues in elementtree and elsewhere due to PyDict_GetItem -> elementtree 
calls PyDict_GetItem without owning a reference to the dict

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27946>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to