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.

Title: cProfile and profile don't work with pygtk/pyqt and sys.exit(0)
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: adelfino, akkana, amaury.forgeotdarc, christian.heimes, docs@python, miss-islington, steve.dower
Priority: normal Keywords: easy, patch

Created on 2009-05-09 18:57 by akkana, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
pywin akkana, 2009-05-09 18:57 Small pygtk demo showing the problem
Pull Requests
URL Status Linked Edit
PR 7938 merged adelfino, 2018-06-26 22:26
PR 8512 merged miss-islington, 2018-07-28 10:01
PR 8515 merged adelfino, 2018-07-28 10:28
Messages (6)
msg87504 - (view) Author: Akkana Peck (akkana) Date: 2009-05-09 18:57
I was following the steps at
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
msg322535 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2018-07-28 10:01
New changeset 937fb55d35373fd2701078251840b6be0465a6e1 by Christian Heimes (Andrés Delfino) in branch 'master':
bpo-5978: Document that profiling needs cmd/function to return (GH-7938)
msg322546 - (view) Author: miss-islington (miss-islington) Date: 2018-07-28 12:23
New changeset c6801b48a1964d87a77f1303e0c6ddf31f54259b by Miss Islington (bot) in branch '3.7':
bpo-5978: Document that profiling needs cmd/function to return (GH-7938)
msg322547 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-07-28 12:24
New changeset 0041d721a6f6b312ef762838d390fc4d64cf5e3a by Steve Dower (Andrés Delfino) in branch '3.6':
[3.6] bpo-5978: Document that profiling needs cmd/function to return (GH-8515)
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50228
2018-07-28 12:26:51steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-07-28 12:24:37steve.dowersetnosy: + steve.dower
messages: + msg322547
2018-07-28 12:23:45miss-islingtonsetnosy: + miss-islington
messages: + msg322546
2018-07-28 10:28:04adelfinosetpull_requests: + pull_request8032
2018-07-28 10:01:45miss-islingtonsetpull_requests: + pull_request8029
2018-07-28 10:01:27christian.heimessetnosy: + christian.heimes
messages: + msg322535
2018-06-26 22:28:28adelfinosetnosy: + adelfino

versions: + Python 2.7, Python 3.6, Python 3.7
2018-06-26 22:26:33adelfinosetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request7548
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