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

fix bug #670311: sys.exit and PYTHONINSPECT #38099

Closed
mbrierst mannequin opened this issue Mar 4, 2003 · 3 comments
Closed

fix bug #670311: sys.exit and PYTHONINSPECT #38099

mbrierst mannequin opened this issue Mar 4, 2003 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mbrierst
Copy link
Mannequin

mbrierst mannequin commented Mar 4, 2003

BPO 697613
Nosy @birkenfeld, @birkenfeld
Files
  • patchblockcalls
  • 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 = None
    closed_at = <Date 2007-03-07.00:35:05.000>
    created_at = <Date 2003-03-04.23:24:20.000>
    labels = ['interpreter-core']
    title = 'fix bug python/cpython#37795: sys.exit and PYTHONINSPECT'
    updated_at = <Date 2007-03-07.00:35:05.000>
    user = 'https://bugs.python.org/mbrierst'

    bugs.python.org fields:

    activity = <Date 2007-03-07.00:35:05.000>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2003-03-04.23:24:20.000>
    creator = 'mbrierst'
    dependencies = []
    files = ['5067']
    hgrepos = []
    issue_num = 697613
    keywords = ['patch']
    message_count = 3.0
    messages = ['42951', '42952', '42953']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'georg.brandl', 'mbrierst']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue697613'
    versions = ['Python 2.3']

    @mbrierst
    Copy link
    Mannequin Author

    mbrierst mannequin commented Mar 4, 2003

    So we want to stop SystemExit from causing
    an actual exit() when using python -i.
    This patch introduces two new API calls,
    PyRun_BlockSysExit and PyRun_UnblockSysExit,
    to set a flag toavoid the exit() call in
    PyErr_PrintEx.

    There are several other ways to fix this
    bug, but I think all of the others I came up
    with would cause more backwards compatibilty
    problems and/or be a lot more work.
    Some possibilities, if anyone is interested,
    would be:

    1. Add a new PyCompilerFlags flag
      This seems a bit ugly, as it's not really
      a "compile flag".
    2. Add some special run routines that
      block the exit.
    3. Add another parameter to existing
      run routines.
    4. Change PyErr_PrintEx so it doesn't
      exit when printing a SystemError, instead
      having the run routines responsible for
      exiting when catching that exception.

    What do you think? Is my patch good enough,
    or would you like something else?

    @mbrierst mbrierst mannequin closed this as completed Mar 4, 2003
    @mbrierst mbrierst mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 4, 2003
    @mbrierst mbrierst mannequin closed this as completed Mar 4, 2003
    @mbrierst mbrierst mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 4, 2003
    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=1188172

    While it works for me, I am not sure whether this is too
    much overhead for fixing a glitch no one else complained about.

    @birkenfeld
    Copy link
    Member

    Committed a variant as rev. 54188.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant