Skip to content

cProfile and profile don't work with pygtk/pyqt and sys.exit(0) #50228

Closed

Description

@akkana
mannequin
BPO 5978
Nosy @amauryfa, @tiran, @akkana, @zooba, @andresdelfino, @miss-islington
PRs
  • bpo-5978: Document that profiling needs cmd/function to return #7938
  • [3.7] bpo-5978: Document that profiling needs cmd/function to return (GH-7938) #8512
  • [3.6] bpo-5978: Document that profiling needs cmd/function to return … #8515
  • Files
  • pywin: Small pygtk demo showing the problem
  • 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 2018-07-28.12:26:51.097>
    created_at = <Date 2009-05-09.18:57:26.738>
    labels = ['easy', '3.8', 'type-feature', '3.7', 'docs']
    title = "cProfile and profile don't work with pygtk/pyqt and sys.exit(0)"
    updated_at = <Date 2018-07-28.12:26:51.096>
    user = 'https://github.com/akkana'

    bugs.python.org fields:

    activity = <Date 2018-07-28.12:26:51.096>
    actor = 'steve.dower'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-07-28.12:26:51.097>
    closer = 'steve.dower'
    components = ['Documentation']
    creation = <Date 2009-05-09.18:57:26.738>
    creator = 'akkana'
    dependencies = []
    files = ['13943']
    hgrepos = []
    issue_num = 5978
    keywords = ['patch', 'easy']
    message_count = 6.0
    messages = ['87504', '109892', '111173', '322535', '322546', '322547']
    nosy_count = 7.0
    nosy_names = ['amaury.forgeotdarc', 'christian.heimes', 'akkana', 'docs@python', 'steve.dower', 'adelfino', 'miss-islington']
    pr_nums = ['7938', '8512', '8515']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue5978'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    Activity

    1. akkana commented on May 9, 2009

      akkanamannequin
      MannequinAuthor

      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).

    2. added
      type-bugAn unexpected behavior, bug, or error
      on May 9, 2009
    3. BreamoreBoy commented on Jul 10, 2010

      BreamoreBoymannequin
      Mannequin

      I'm note sure if this is a library bug, doc bug, external library issue or what, anyone got any true idea?

    4. amauryfa commented on Jul 22, 2010

      @amauryfa
      Contributor

      Profiling only works on functions that actually return; maybe we could
      add something about this fact in the documentation

    5. added
      type-featureA feature request or enhancement
      and removed
      type-bugAn unexpected behavior, bug, or error
      on Feb 11, 2018
    6. tiran commented on Jul 28, 2018

      @tiran
      Member

      New changeset 937fb55 by Christian Heimes (Andrés Delfino) in branch 'master':
      bpo-5978: Document that profiling needs cmd/function to return (GH-7938)
      937fb55

    7. miss-islington commented on Jul 28, 2018

      @miss-islington
      Contributor

      New changeset c6801b4 by Miss Islington (bot) in branch '3.7':
      bpo-5978: Document that profiling needs cmd/function to return (GH-7938)
      c6801b4

    8. zooba commented on Jul 28, 2018

      @zooba
      Member

      New changeset 0041d72 by Steve Dower (Andrés Delfino) in branch '3.6':
      [3.6] bpo-5978: Document that profiling needs cmd/function to return (GH-8515)
      0041d72

    9. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of life3.8 (EOL)end of lifedocsDocumentation in the Doc direasytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions