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

sys.excepthook does not work with -m command line switch #44540

Closed
tebeka mannequin opened this issue Feb 2, 2007 · 2 comments
Closed

sys.excepthook does not work with -m command line switch #44540

tebeka mannequin opened this issue Feb 2, 2007 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@tebeka
Copy link
Mannequin

tebeka mannequin commented Feb 2, 2007

BPO 1650899
Nosy @tebeka

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-02-02.19:42:14.000>
created_at = <Date 2007-02-02.19:27:30.000>
labels = ['interpreter-core', 'invalid']
title = 'sys.excepthook does not work with -m command line switch'
updated_at = <Date 2007-02-02.19:42:14.000>
user = 'https://github.com/tebeka'

bugs.python.org fields:

activity = <Date 2007-02-02.19:42:14.000>
actor = 'tebeka'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2007-02-02.19:27:30.000>
creator = 'tebeka'
dependencies = []
files = []
hgrepos = []
issue_num = 1650899
keywords = []
message_count = 2.0
messages = ['31163', '31164']
nosy_count = 1.0
nosy_names = ['tebeka']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1650899'
versions = ['Python 2.5']

@tebeka
Copy link
Mannequin Author

tebeka mannequin commented Feb 2, 2007

crashlog.py is the following:
import sys

  def excepthook(type, value, traceback):
      print "BUMMER"

  sys.excepthook = excepthook

When crash.py is like:
import crashlog
raise ValueError("so sad")

The it works as expected:
[mtebeka@lakshmi - 11:22] ~ $python crash.py
BUMMER
[mtebeka@lakshmi - 11:23] ~ $

However when I try to load crashlog using -m and leave crash.py like:
raise ValueError("so sad")

The nothing (not even original excepthook is called):
[mtebeka@lakshmi - 11:23] ~ $python -m crashlog crash.py
[mtebeka@lakshmi - 11:25] ~ $

@tebeka tebeka mannequin closed this as completed Feb 2, 2007
@tebeka tebeka mannequin added invalid interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Feb 2, 2007
@tebeka tebeka mannequin closed this as completed Feb 2, 2007
@tebeka tebeka mannequin added invalid interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Feb 2, 2007
@tebeka
Copy link
Mannequin Author

tebeka mannequin commented Feb 2, 2007

Didn't understand how -m works, my bad

@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
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

0 participants