Skip to content

pydoc topics, keywords and symbols always use pager instead of output #81936

Closed

Description

@eht16
mannequin
BPO 37755
Nosy @eht16
PRs
  • bpo-37755: Use configured output in pydoc instead of pager #15105
  • 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 = None
    created_at = <Date 2019-08-04.12:48:20.274>
    labels = ['3.8', 'type-bug', 'library']
    title = 'pydoc topics, keywords and symbols always use pager instead of output'
    updated_at = <Date 2019-08-04.12:55:23.691>
    user = 'https://github.com/eht16'

    bugs.python.org fields:

    activity = <Date 2019-08-04.12:55:23.691>
    actor = 'eht16'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2019-08-04.12:48:20.274>
    creator = 'eht16'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37755
    keywords = ['patch']
    message_count = 1.0
    messages = ['348983']
    nosy_count = 1.0
    nosy_names = ['eht16']
    pr_nums = ['15105']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37755'
    versions = ['Python 3.8']

    Activity

    1. eht16 commented on Aug 4, 2019

      eht16mannequin
      MannequinAuthor

      I noticed a probably unintended behavior in help() usage:

      when an output is set on pydoc.Helper(), most of its methods
      use this output instead of a pager.
      But 'True', 'False' and 'None' as well as all topics, keywords
      and symbols always use a pager instead of the configured output.

      My use case is to use the pydoc help system to display help contents
      in Geany (a text editor) in a graphical manner
      (and so I cannot make any use of a pager).

      Example code:

      #!/usr/bin/env python3
      # -- coding: utf-8 --

      from io import StringIO
      import pydoc
      import sys
      
      
      if __name__ == '__main__':
          help_text = StringIO()
      
          helper = pydoc.Helper(output=help_text)
          # help contents are written to help_text as expected
          helper.help('pydoc')
      
          # the following calls each show the help contents in a pager instead
          # of using the configured output
          helper.help('True')
          helper.help('False')
          helper.help('None')
          helper.help('**')  # symbol example
          helper.help('SEQUENCES')  # topic example
          helper.help('await')  # keyword example

      Tested against Python 3.7.3.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Aug 4, 2019
    3. transferred this issue fromon Apr 10, 2022
    4. added
      3.12only security fixes
      3.13only security fixes
      3.14bugs and security fixes
      and removed on Jun 8, 2024
    5. serhiy-storchaka commented on Jun 8, 2024

      @serhiy-storchaka
      Member

      Thank you for your contribution @eht16. Sorry it took so long to review and merge your PR.

    6. eht16 commented on Jun 8, 2024

      @eht16
      ContributorAuthor

      It took me to answer almost as long :D.
      Thank you for the review.

    7. merwok commented on Dec 17, 2024

      @merwok
      Member

      Thanks for fixing this old bug!

    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.12only security fixes3.13only security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions