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 lemburg
Recipients belopolsky, georg.brandl, jcea, lemburg, mark.dickinson, ncoghlan, pitrou
Date 2011-02-25.08:32:36
SpamBayes Score 2.6519342e-12
Marked as misclassified No
Message-id <4D676923.6020505@egenix.com>
In-reply-to <AANLkTi=9Aqr07Ez0133qbr+Wjbv6HTbo2XoR19g1w+Pz@mail.gmail.com>
Content
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.
History
Date User Action Args
2011-02-25 08:32:38lemburgsetrecipients: + lemburg, georg.brandl, jcea, mark.dickinson, ncoghlan, belopolsky, pitrou
2011-02-25 08:32:36lemburglinkissue11286 messages
2011-02-25 08:32:36lemburgcreate