classification
Title: cProfile and profile don't work with pygtk/pyqt and sys.exit(0)
Type: enhancement Stage: needs patch
Components: Documentation Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: akkana, amaury.forgeotdarc, docs@python
Priority: normal Keywords: easy

Created on 2009-05-09 18:57 by akkana, last changed 2018-02-11 17:00 by cheryl.sabella.

Files
File name Uploaded Description Edit
pywin akkana, 2009-05-09 18:57 Small pygtk demo showing the problem
Messages (3)
msg87504 - (view) Author: Akkana Peck (akkana) Date: 2009-05-09 18:57
I was following the steps at http://docs.python.org/library/profile.html
to try to profile a pygtk program, but it wasn't working -- I was
getting no output at all from either cProfile or profile.

The problem turned out to be that I was exiting by calling sys.exit(0),
because that's what most pygtk programs I'd seen were doing. Changing
that to gtk.main_quit() made profiling work (but it took a long time to
track that down).

Apparently the same thing happens in pyqt if you call sys.exit(0).
msg109892 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-10 17:00
I'm note sure if this is a library bug, doc bug, external library issue or what, anyone got any true idea?
msg111173 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-07-22 13:41
Profiling only works on functions that actually return; maybe we could
add something about this fact in the documentation
History
Date User Action Args
2018-02-11 17:00:51cheryl.sabellasetkeywords: + easy
stage: needs patch
type: behavior -> enhancement
versions: + Python 3.8, - Python 3.1, Python 2.7, Python 3.2
2014-02-03 19:41:25BreamoreBoysetnosy: - BreamoreBoy
2010-10-21 13:31:14georg.brandlsetassignee: docs@python

components: + Documentation, - Demos and Tools
nosy: + docs@python
2010-07-22 13:41:21amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg111173
2010-07-10 17:00:55BreamoreBoysetnosy: + BreamoreBoy

messages: + msg109892
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.5
2009-05-09 18:57:26akkanacreate