[Python-Dev] Re: [Python-checkins] python/dist/src/Modules readline.c, 2.82, 2.83

Michael Hudson mwh at python.net
Wed Mar 30 13:28:16 CEST 2005


mwh at users.sourceforge.net writes:

> Update of /cvsroot/python/python/dist/src/Modules
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10274
>
> Modified Files:
> 	readline.c 
> Log Message:
> Fixes for
>
> [ 1166660 ] The readline module can cause python to segfault
>
> It seems to me that the code I'm rewriting here attempted to call any
> user-supplied hook functions using the thread state of the thread that
> called the hook-setting function, as opposed to that of the thread
> that is currently executing.  This doesn't work, in general.
>
> Fix this by using the PyGILState API (It wouldn't be that hard to
> define a dummy version of said API when #ifndef WITH_THREAD, would
> it?).
>
> Also, check the conversion to integer of the return value of a hook
> function for errors (this problem was mentioned in the ipython bug
> report linked to in the above bug).

Oh, and I forgot to say: this should go into realease24-maint when
that opens again.

Cheers,
mwh

-- 
  You're going to have to remember that I still think of Twisted as
  a big multiplayer game, and all this HTTP stuff is just kind of a
  grotty way to display room descriptions.          -- Glyph Lefkowitz


More information about the Python-Dev mailing list