Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py_Main() does not return on sys.exit() #49477

Closed
Rogi mannequin opened this issue Feb 12, 2009 · 2 comments
Closed

Py_Main() does not return on sys.exit() #49477

Rogi mannequin opened this issue Feb 12, 2009 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@Rogi
Copy link
Mannequin

Rogi mannequin commented Feb 12, 2009

BPO 5227
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2009-03-31.18:33:25.748>
created_at = <Date 2009-02-12.13:00:47.139>
labels = ['docs']
title = 'Py_Main() does not return on sys.exit()'
updated_at = <Date 2009-03-31.18:33:25.747>
user = 'https://bugs.python.org/Rogi'

bugs.python.org fields:

activity = <Date 2009-03-31.18:33:25.747>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2009-03-31.18:33:25.748>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2009-02-12.13:00:47.139>
creator = 'Rogi'
dependencies = []
files = []
hgrepos = []
issue_num = 5227
keywords = []
message_count = 2.0
messages = ['81760', '84854']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'Rogi']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue5227'
versions = ['Python 2.6']

@Rogi
Copy link
Mannequin Author

Rogi mannequin commented Feb 12, 2009

From teh documentation:
http://docs.python.org/c-api/veryhigh.html

int Py_Main(int argc, char **argvThe 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 programs
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.

However, if teh user type sys.exit(whatever), Py_Main() is call exit()
instead of returning, which cause program termination before cleanup and
stuff.

@Rogi Rogi mannequin added the docs Documentation in the Doc dir label Feb 13, 2009
@Rogi Rogi mannequin assigned birkenfeld Feb 13, 2009
@birkenfeld
Copy link
Member

Documented in r70857.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant