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 nnorwitz
Recipients amaury.forgeotdarc, benjamin.peterson, eric.smith, nnorwitz
Date 2008-05-07.04:03:21
SpamBayes Score 0.034467228
Marked as misclassified No
Message-id <1210133012.39.0.648396690911.issue2772@psf.upfronthosting.co.za>
In-reply-to
Content
Why not use the normal recursion check mechanism?  Specifically,

       if (Py_EnterRecursiveCall("unicode % "))
                return NULL;
       // err = Warn();
       Py_LeaveRecursiveCall();

I don't see where the problem with threads comes in.  The GIL is held
and shouldn't be released during this call.  That may not be quite true
(it's conceivable the GIL is released when warning).  I'm not sure what
happens with the I/O system at this point, it's possible that releases
the GIL.  However, if GIL is released and re-acquired in PyWarn_WarnEx()
there are probably bigger issues than this patch that will need to be
addressed.  Note that since the warnings module is now implemented in C,
this should be easier to deal with.

Using the macros above in essence uses TLS, but through Python's
PyThreadState.
History
Date User Action Args
2008-05-07 04:03:33nnorwitzsetspambayes_score: 0.0344672 -> 0.034467228
recipients: + nnorwitz, amaury.forgeotdarc, eric.smith, benjamin.peterson
2008-05-07 04:03:32nnorwitzsetspambayes_score: 0.0344672 -> 0.0344672
messageid: <1210133012.39.0.648396690911.issue2772@psf.upfronthosting.co.za>
2008-05-07 04:03:31nnorwitzlinkissue2772 messages
2008-05-07 04:03:29nnorwitzcreate