[ python-Bugs-672035 ] Py_Main() does not perform to spec
SourceForge.net
noreply at sourceforge.net
Tue Jan 11 04:48:57 CET 2005
Bugs item #672035, was opened at 2003-01-21 17:42
Message generated for change (Comment added) made by facundobatista
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: Fixed
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: Facundo Batista (facundobatista)
Date: 2005-01-11 00:48
Message:
Logged In: YES
user_id=752496
Effectively closing it.
----------------------------------------------------------------------
Comment By: Douglas Napoleone (derivin)
Date: 2003-04-21 15:33
Message:
Logged In: YES
user_id=541557
Patch was applied, just closing
----------------------------------------------------------------------
Comment By: Douglas Napoleone (derivin)
Date: 2003-01-21 17: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
More information about the Python-bugs-list
mailing list