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

argparse execute system exit in python prompt #54715

Closed
TarsisAzevedo mannequin opened this issue Nov 22, 2010 · 2 comments
Closed

argparse execute system exit in python prompt #54715

TarsisAzevedo mannequin opened this issue Nov 22, 2010 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@TarsisAzevedo
Copy link
Mannequin

TarsisAzevedo mannequin commented Nov 22, 2010

BPO 10506
Nosy @bitdancer

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 2010-11-22.20:19:41.800>
created_at = <Date 2010-11-22.15:15:21.334>
labels = ['invalid', 'type-bug', 'library']
title = 'argparse execute system exit in python prompt'
updated_at = <Date 2010-11-22.20:19:41.798>
user = 'https://bugs.python.org/TarsisAzevedo'

bugs.python.org fields:

activity = <Date 2010-11-22.20:19:41.798>
actor = 'r.david.murray'
assignee = 'none'
closed = True
closed_date = <Date 2010-11-22.20:19:41.800>
closer = 'r.david.murray'
components = ['Library (Lib)']
creation = <Date 2010-11-22.15:15:21.334>
creator = 'Tarsis.Azevedo'
dependencies = []
files = []
hgrepos = []
issue_num = 10506
keywords = []
message_count = 2.0
messages = ['122134', '122162']
nosy_count = 4.0
nosy_names = ['bethard', 'r.david.murray', 'santoso.wijaya', 'Tarsis.Azevedo']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue10506'
versions = ['Python 2.7', 'Python 3.2']

@TarsisAzevedo
Copy link
Mannequin Author

TarsisAzevedo mannequin commented Nov 22, 2010

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?!

@TarsisAzevedo TarsisAzevedo mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Nov 22, 2010
@bitdancer
Copy link
Member

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.

@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
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant