New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

_PyObject_HasAttrId() can return -1, 0 or 1. It returns -1 when cannot create a 
string (most likely due to MemoryError or UnicodeDecodeError), but returns 0 
and silences all exceptions raised when look up the attribute (including 
MemoryError, KeybordInterruptError and RecursionError). Silencing arbitrary 
exceptions is bad, and the interface of the function is inconsistent, so it is 
better to remove it and replace all 5 of its occurrences in 3 files with 
_PyObject_LookupAttrId(). It is private API, so we can do it without breaking 
user code.

----------
components: Interpreter Core
messages: 378370
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove _PyObject_HasAttrId
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

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

Reply via email to