Message129337
Alexander Belopolsky wrote:
>
> Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment:
>
> On Thu, Feb 24, 2011 at 3:54 PM, Antoine Pitrou <report@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. |
|
Date |
User |
Action |
Args |
2011-02-25 08:32:38 | lemburg | set | recipients:
+ lemburg, georg.brandl, jcea, mark.dickinson, ncoghlan, belopolsky, pitrou |
2011-02-25 08:32:36 | lemburg | link | issue11286 messages |
2011-02-25 08:32:36 | lemburg | create | |
|