[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2022-01-23 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 691506f4e9408a1205166f99640946ad7822e302 by Weipeng Hong in 
branch 'main':
bpo-46103: Fix inspect.getmembers to only get __bases__ from class (GH-30147)
https://github.com/python/cpython/commit/691506f4e9408a1205166f99640946ad7822e302


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2021-12-17 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2021-12-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

PR edits inspect._getmembers. I nosied people who have edited it previously.

--
nosy: +ethan.furman, ping, pitrou, terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2021-12-16 Thread hongweipeng


Change by hongweipeng :


--
keywords: +patch
pull_requests: +28367
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30147

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2021-12-16 Thread hongweipeng


New submission from hongweipeng :

root@debian:/workspace/cpython# ./python
Python 3.11.0a3+ (heads/main-dirty:b123ad8030, Dec 16 2021, 06:16:15) [GCC 
10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> class Foo:
...   def __getattr__(self, attr):
... return None
... 
>>> inspect.getmembers(Foo())
Traceback (most recent call last):
  File "", line 1, in 
  File "/workspace/cpython/Lib/inspect.py", line 488, in getmembers
return _getmembers(object, predicate, getattr)
   ^^^
  File "/workspace/cpython/Lib/inspect.py", line 455, in _getmembers
for base in object.__bases__:
^
TypeError: 'NoneType' object is not iterable

--
components: Library (Lib)
messages: 408717
nosy: hongweipeng
priority: normal
severity: normal
status: open
title: inspect.getmembers will call the instance __bases__ attribute, which may 
cause an exception
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com