A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-March/117227.html below:

[Python-Dev] Assertion in _PyManagedBuffer_FromObject()

[Python-Dev] Assertion in _PyManagedBuffer_FromObject() [Python-Dev] Assertion in _PyManagedBuffer_FromObject()Stefan Krah stefan at bytereef.org
Fri Mar 2 13:55:40 CET 2012
Nick Coghlan <ncoghlan at gmail.com> wrote:
> However, given the lack of control, an assert() isn't the appropriate
> tool here - PyObject_GetBuffer itself should be *checking* the
> constraint and then reporting an error if the check fails. Otherwise a
> misbehaving extension module could trivially crash the Python
> interpreter by returning a bad Py_buffer.

I'm not so sure. Extension modules that use the C-API in wrong or
undocumented ways can always crash the interpreter. This assert()
should be triggered in the first unit test of the module. Now, if
the module does not have unit tests or they don't test against a
new Python version is that really our problem?

Modules do need to be recompiled anyway due to the removal of
Py_buffer.smalltable, otherwise they will almost certainly crash.

Perhaps an addition to whatsnew/3.3 would be sufficient.


Stefan Krah


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4