You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace PyDict_GetItem() with PyDict_GetItemWithError() #64814
Keep the docs factual and straight-forward. In the docs for PyDict_GetItem(), note that errors will get suppressed. To
get error reporting use PyDict_GetItemWithError() instead.
Activity
vstinner commentedon Feb 13, 2014
See this huge warning in the definition of PyDict_GetItem:
/* Note that, for historical reasons, PyDict_GetItem() suppresses all errors
*/
PyObject *
PyDict_GetItem(PyObject *op, PyObject *key)
{ ... }
PyDict_GetItem() should avoided because it may hide important exceptions like KeyboardInterrupt or MemoryError.
See for example bpo-14537 for a specific error.
By the way, the PyDict_GetItem() documentation should contain a big red warning and suggest to use PyDict_GetItemWithError() instead.
rhettinger commentedon Feb 13, 2014
Please, no more big red warnings.
Keep the docs factual and straight-forward. In the docs for PyDict_GetItem(), note that errors will get suppressed. To
get error reporting use PyDict_GetItemWithError() instead.
vstinner commentedon Jun 28, 2017
Sorry, I lost track of this issue, so I just close it.