This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2017-04-12.20:58:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za>
In-reply-to
Content
PyObject_Size(), PySequence_Size() and PyMapping_Size() can raise an exception. But not always this is checked after using them. This can lead to a crash. For example:

>>> import io
>>> class R(io.IOBase):
...     def readline(self): return None
... 
>>> next(R())
Fatal Python error: a function returned a result with an error set
TypeError: object of type 'NoneType' has no len()                                                                                                                      

The above exception was the direct cause of the following exception:

SystemError: <built-in function next> returned a result with an error set

Current thread 0xb749c700 (most recent call first):
  File "<stdin>", line 1 in <module>
History
Date User Action Args
2017-04-12 20:58:52serhiy.storchakasetrecipients: + serhiy.storchaka
2017-04-12 20:58:52serhiy.storchakasetmessageid: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za>
2017-04-12 20:58:52serhiy.storchakalinkissue30061 messages
2017-04-12 20:58:52serhiy.storchakacreate