Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread M.Utku K.
Hi, Josiah Carlson [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: strip IMHO this should be left to hooker(apparerently not right word, but you get the point :) ). If he allocates more mem. or does heavy stuff, that will just fail. Anyway abort() is a failure too. Either abort()

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread M.Utku K.
Hi, James William Pye [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: On Tue, 2005-05-03 at 13:39 -0700, Josiah Carlson wrote: If I'm wrong, I'd like to hear it, but I'm still waiting for your patch on sourceforge. Well, if he lost/loses interest for whatever reason, I'd be willing

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread James William Pye
On Wed, 2005-05-04 at 09:46 +, M.Utku K. wrote: The reinit. issue: The old way of returning old callback when a new callback is set sounds OK. Or better way: there may be an array to hold all the callbacks, Py_FatalError iterates and call each. Why should reinitialization be allowed at

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread Jeff Epler
On Wed, May 04, 2005 at 03:29:33PM +, M.Utku K. wrote: James William Pye [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Why should reinitialization be allowed at all? Seems to me that this feature should be exclusively reserved for an embedding application to handle the fatal in

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread James William Pye
On Wed, 2005-05-04 at 15:29 +, M.Utku K. wrote: Extension developer may discard or call them at his own will. That's the issue, an extension developer shouldn't be able to discard it, as I, the embedder, do not want my hook to be clobbered. The extension developer doesn't set the context of

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread M.Utku K.
Hi all, strip. What if more than one extension needs it ? Curently Im doing callback_type SetCallBack(callback_type newfunc) This will set the callback to newfunc and return the old one. Extension developer may discard or call them at his own will. What do you think?

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread M.Utku K.
M.Utku K. [EMAIL PROTECTED] wrote in news:Xns964CE11B16061token@ 80.91.229.5: _Callback(PyFatalError_Func func) ) is in pyerrors.h but implemenatiton is is in Pythonrun.c. Is it OK? Im listening for more. Sorry, just checked decl. will be in pydebug.h

[Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread m.u.k
Greetings, Currently Py_FatalError only dumps the error to stderr and calls abort(). When doing quirky things with the interpreter, it's so annoying that process just terminates. Are there any reason why we still dont have a simple callback to hook Py_FatalError. PS. If the answer is because

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread Guido van Rossum
Currently Py_FatalError only dumps the error to stderr and calls abort(). When doing quirky things with the interpreter, it's so annoying that process just terminates. Are there any reason why we still dont have a simple callback to hook Py_FatalError. PS. If the answer is because no one

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread Josiah Carlson
m.u.k [EMAIL PROTECTED] wrote: Currently Py_FatalError only dumps the error to stderr and calls abort(). When doing quirky things with the interpreter, it's so annoying that process just terminates. Are there any reason why we still dont have a simple callback to hook Py_FatalError. PS.

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread m.u.k
Hi, Guido van Rossum [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Your efforts would be better directed towards fixing the causes of the fatal errors. I see no need to hook Py_FatalError, but since it's open source, you are of course free to patch your own copy if your urge is truly

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread Jeff Epler
On Tue, May 03, 2005 at 09:15:42AM -0700, Guido van Rossum wrote: But tell me, what do you want the process to do instead of terminating? Py_FatalError is used in situations where raising an exception is impossible or would do more harm than good. In an application which embeds Python, I want

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread m.u.k
Hi, Josiah Carlson [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: In looking at the use of Py_FatalError in the Python Sources (it's a 10 meg tarball that is well worth the download), it looks as though its use shows a Fatal error (hence the name). Things like Inconsistant interned

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread Josiah Carlson
m.u.k [EMAIL PROTECTED] wrote: Hi, Guido van Rossum [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Your efforts would be better directed towards fixing the causes of the fatal errors. I see no need to hook Py_FatalError, but since it's open source, you are of course free

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread Josiah Carlson
m.u.k [EMAIL PROTECTED] wrote: Josiah Carlson [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Offering any hook for Py_FatalError may not even be enough, as some of those errors are caused by insufficient memory. What if a hook were available, but it couldn't be called because

Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread James William Pye
On Tue, 2005-05-03 at 12:54 -0500, Jeff Epler wrote: On Tue, May 03, 2005 at 09:15:42AM -0700, Guido van Rossum wrote: But tell me, what do you want the process to do instead of terminating? Py_FatalError is used in situations where raising an exception is impossible or would do more harm