[issue6498] Py_Main() does not return on SystemExit

2011-03-27 Thread Mark Hammond
Mark Hammond added the comment: Isn't the only problem here that the docs refer to SystemError instead of SystemExit - eg 'raise SystemError("foo")' in an interactive session doesn't terminate the process at all (and I don't believe it should) whereas SystemExit obviously does. -- no

[issue6498] Py_Main() does not return on SystemExit

2011-03-27 Thread Rogi
Rogi added the comment: @mhammond Wat did you say? I tried to fix this issue at teh time with no success. It would require too much rewriting. I have not found any way to handle exceptions at C level using this function up to teh present time. --

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Mark Hammond
Mark Hammond added the comment: Note the quoted documentation in comment 1, the paragraph "Note that if an otherwise unhandled SystemError ..." I don't think that paragraph is correct - SystemError doesn't seem to terminate Py_Main - but if you replace "SystemError" with "SystemExit", that pa

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Eric Frederich
Eric Frederich added the comment: So there is a disconnect. You can either change the documentation to match the behavior or you can change the code to match the documentation. I would prefer to leave the documentation alone and make Py_Main return rather than exit on sys.exit. That's just

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Rogi
Rogi added the comment: Sorry, some years have passed since I posted this. I will take a look on teh code again. -- ___ Python tracker ___ ___

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Rogi
Rogi added the comment: I reviewed teh problem and rewrote teh text to better explain what is happening. Also, I noticed teh change to teh docs, and in fact it is not correct that teh functions call exit() on SystemError. *** From teh docs: http://docs.python.org/c-api/veryhigh.html int Py_M

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Mark Hammond
Mark Hammond added the comment: @Rogi - you seem to have a problem with your keyboard - the 'h' and 'e' keys seem to have been swapped. The docs are wrong regardless - I don't think anyone would suggest the behaviour match the docs regarding SystemError - having Py_Main return on SystemError

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Rogi
Rogi added the comment: @mhammond Maybe its just me but it seems to be a really bad idea to let those functions terminate your process as they wish. Teh programmer should be allowed to control teh flow of his application. However, I am not teh only one affected by this. I recal

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Rogi
Rogi added the comment: @mhammond After reading your post again I noticed you talk about SystemError and not SystemExit. In fact, Py_Main() should not return on SystemError. Teh documentation states "if the interpreter exits due to an exception", which implies teh interpreter _exiting_,

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Mark Hammond
Mark Hammond added the comment: @Rogi - you might like to re-read my responses a couple more times: * I refer to SystemError as the docs *you quoted* refer to SystemError. Therefore, we should *not* make the implementation match the docs - the docs would be wrong *even if* we change Python t

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Rogi
Rogi added the comment: @mhammond You said: "The docs are wrong regardless - I don't think anyone would suggest the behaviour match the docs regarding SystemError - having Py_Main return on SystemError would be backwards incompatible." but teh problem is:

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Mark Hammond
Mark Hammond added the comment: > What teh docs says currently about SystemError calling > exit() is just _WRONG_. Correct - the docs should be fixed - which is what this bug is currently addressing (see the "Components" and "Assigned To" fields) > Also, I am not asking for a new feature. I'

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Rogi
Rogi added the comment: Fair. Still I dont liek it very much. I will return! -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Mark Hammond
Mark Hammond added the comment: For completeness, here is a doc patch against 2.6 which corrects the documentation. -- keywords: +patch Added file: http://bugs.python.org/file21447/bug-6498.patch ___ Python tracker

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Mark Hammond
Changes by Mark Hammond : -- keywords: +needs review -patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue6498] Py_Main() does not return on SystemExit

2011-03-28 Thread Rogi
Rogi added the comment: I may be wrong, but I think Py_Main() will _never_ return 1. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Rogi
Rogi added the comment: Oh, and other functions on this doc, such as PyRun_SimpleStringFlags(), have this same documentation problem about SystemError. -- ___ Python tracker ___

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Mark Hammond
Mark Hammond added the comment: It will return 1 if you specify a script to run and that has an unhandled exception. -- ___ Python tracker ___ __

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Mark Hammond
Mark Hammond added the comment: Good catch - new patch with PyRun_SimpleStringFlags() corrected too. -- keywords: +patch Added file: http://bugs.python.org/file21448/bug-6498.patch ___ Python tracker __

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The SystemExit vs. SystemError is clearly a typo in the doc. The VC comment accompanying the addition of that note says "note that Py_Main doesnt return on SystemExit." See [e5d8f0c0d634] and #5227. -- nosy: +belopolsky ___

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The updated doc patch is missing :exc: markup on one of "SystemExit"s. -- ___ Python tracker ___ _

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Andreas Stührk
Andreas Stührk added the comment: The comment in the source that describes `Py_InspectFlag` also says `SystemError` instead of `SystemExit`. I changed that and added the missing :exc: for the SystemExit and created a patch for 3.1. -- nosy: +Trundle Added file: http://bugs.python.org/

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Andreas Stührk
Changes by Andreas Stührk : Added file: http://bugs.python.org/file21462/issue6498_31.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6498] Py_Main() does not return on SystemExit

2011-03-31 Thread Éric Araujo
Changes by Éric Araujo : -- versions: +Python 2.7 -Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue6498] Py_Main() does not return on SystemExit

2011-05-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0311f62714f7 by Georg Brandl in branch '3.1': Closes #6498: fix several misspellings of "SystemExit" as "SystemError". http://hg.python.org/cpython/rev/0311f62714f7 New changeset 7089afd69a1a by Georg Brandl in branch '3.2': Merge #6498 fix from 3.

[issue6498] Py_Main() does not return on SystemExit

2009-07-16 Thread Rogi
New submission from Rogi : >From teh docs: http://docs.python.org/c-api/veryhigh.html int Py_Main(int argc, char **argv)¶ The main program for the standard interpreter. This is made available for programs which embed Python. The argc and argv parameters should be prepared exactly as those

[issue6498] Py_Main() does not return on SystemExit

2009-07-16 Thread Raphaela
Raphaela added the comment: I'm having the same problem. The source of the problem seem to be in PyRun_InteractiveOneFlags(). It prints and clears the last error. -- nosy: +Rakeka ___ Python tracker ___

[issue6498] Py_Main() does not return on SystemExit

2009-07-17 Thread Rogi
Rogi added the comment: As a workaround, I copied teh function PyRun_InteractiveOneFlags() to my own source and modified it so it would not print or clear exceptions. However, I have never found documentation about PyArena* or PyParser_AST*. Are those functions public or just for internal use?

[issue6498] Py_Main() does not return on SystemExit

2009-08-22 Thread Rogi
Rogi added the comment: bump -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/

[issue6498] Py_Main() does not return on SystemExit

2009-08-22 Thread Raphaela
Raphaela added the comment: bump =op -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue6498] Py_Main() does not return on SystemExit

2009-08-26 Thread STINNER Victor
STINNER Victor added the comment: Can you propose a patch fixing this issue? -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-li

[issue6498] Py_Main() does not return on SystemExit

2009-08-28 Thread Rogi
Rogi added the comment: I will try to fix and submit a patch. Just a second =op -- ___ Python tracker ___ ___ Python-bugs-list mailing