[Python-bugs-list] [ python-Bugs-672035 ] Py_Main() does not perform to spec

SourceForge.net noreply@sourceforge.net
Tue, 21 Jan 2003 12:50:15 -0800


Bugs item #672035, was opened at 2003-01-21 15:42
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=672035&group_id=5470

Category: Extension Modules
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Douglas Napoleone (derivin)
Assigned to: Nobody/Anonymous (nobody)
Summary: Py_Main() does not perform to spec

Initial Comment:
I consider this a code bug, not a documentation issue 
as the documentation is the behavior we want.

>From 
http://www.python.org/doc/current/api/veryhigh.html#l2h-
47  :
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 which are passed to a C program's main() 
function. It is important to note that the argument list 
may be modified (but the contents of the strings pointed 
to by the argument list are not). The return value will be 
the integer passed to the sys.exit() function, 1 if the 
interpreter exits due to an exception, or 2 if the 
parameter list does not represent a valid Python 
command line. 

I have checked the code for 2.2, 2.2.1, 2.2.2, and r2.3al
In all cases the code will call exit(2) in C when an 
improper commandline is given instead of returning 2.
ALL exit() calls should be removed from this module. 
The return value should be passed to exit or returned 
from main() by the caller of Py_Main() and NOT from 
within this call.

python.c's main() would not need to be changed as it 
already does this.


----------------------------------------------------------------------

Comment By: Douglas Napoleone (derivin)
Date: 2003-01-21 15:50

Message:
Logged In: YES 
user_id=541557

The max recursion limit problem in the re module is well-known.  
Until this limitation in the implementation is removed, to work 
around it check

http://www.python.org/dev/doc/devel/lib/module-re.html
http://python/org/sf/493252

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=672035&group_id=5470