This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: argparse execute system exit in python prompt
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Tarsis.Azevedo, bethard, r.david.murray, santoso.wijaya
Priority: normal Keywords:

Created on 2010-11-22 15:15 by Tarsis.Azevedo, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg122134 - (view) Author: Tarsis Azevedo (Tarsis.Azevedo) Date: 2010-11-22 15:15
Hi all, when I use argparse in python prompt, and raise a exception, as the code below:

    >>> import argparse
    >>> parser = argparse.ArgumentParser()
    >>> parser.add_argument('-i' type=int)
    >>> parser.parse_args(['-i', 'a'])

the prompt is closed.

This behavior this in error function (Lib/argparse.py:2325)
I think in python prompt this behavior it's wrong.

it's right?!
msg122162 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-11-22 20:19
This is working as designed.  Whether or not the design is correct has been debated in the past.  If you want to re-debate it the appropriate place is probably python-ideas.
History
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54715
2010-11-22 20:19:41r.david.murraysetstatus: open -> closed

nosy: + r.david.murray, bethard
messages: + msg122162

resolution: not a bug
2010-11-22 18:53:57santoso.wijayasetnosy: + santoso.wijaya

versions: + Python 2.7
2010-11-22 15:15:21Tarsis.Azevedocreate