[Python-Dev] Proposal: thread.get_dict

Michael Hudson mwh at python.net
Tue Jun 29 13:53:46 EDT 2004

Armin Rigo <arigo at tunes.org> writes:

> Hello Michael,
> On Mon, Jun 28, 2004 at 03:00:32PM -0400, Chermside, Michael wrote:
>> > I am pretty sure that some extension modules would badly 
>> > crash if arbitrary
>> > Python code would be allowed to temper with the data that 
>> > they store there.  
>> We're all consenting adults here. Tampering with the private
>> data of an extension module is a well-known way to crash
>> Python.
> Is it?  I am not aware of any such example in the standard library.  I am sure
> that it would be considered as a bug.  The only (internal and expected) ways
> to crash the Python interpreter from Python are currently to abuse new.code()
> or gc.getreferents().

I know at least two more: abusing CObjects a la my post to python-dev
some months back now, and the oft-repeated "falling off the end of the

> If an extension module allows this kind of tampering from Python
> code I'd consider it poorly written.

I concur.


  ... but I guess there are some things that are so gross you just have
  to forget, or it'll destroy something within you.  perl is the first
  such thing I have known.              -- Erik Naggum, comp.lang.lisp

More information about the Python-Dev mailing list