Marc-Andre Lemburg <m...@egenix.com> added the comment:

Alexander Belopolsky wrote:
> 
> Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
> 
> On Thu, Feb 24, 2011 at 3:54 PM, Antoine Pitrou <rep...@bugs.python.org> 
> wrote:
> ..
>> I've committed the part of the patch which disallows a NULL data pointer
>> with PyMemoryView_FromBuffer in r88550 and r88551.
> 
> Is it possible to create such buffer in Python (other than by
> exploiting a bug or writing a rogue extension module)?  If not, this
> should be a SystemError or even just an assert() rather than
> ValueError.

We normally raise a SystemError for invalid NULL pointers, not
ValueErrors.

SystemError is used for things that go wrong at the C level and
indicate a likely programming error at that level. The origin of
that error is not important, but the check will usually happen
in the interpreter.

FWIW, it's also used in C extensions for much the same reason,
so in the wild you'll also find SystemErrors raised by
3rd party extensions.

----------
title: Some "trivial" python 2.x pickles fails to load in Python 3.2 -> Some 
"trivial" python 2.x pickles fails to load in      Python 3.2

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

Reply via email to