GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pydoc should return non-zero exit code when a query is not found · Issue #89130 · python/cpython

pydoc should return non-zero exit code when a query is not found #89130

New issue
Copy link
New issue
Copy link
Closed
Closed
pydoc should return non-zero exit code when a query is not found#89130
Copy link
Labels
3.11only security fixesonly security fixestype-featureA feature request or enhancementA feature request or enhancement

Description

gpanders
mannequin
opened on Aug 21, 2021
Issue body actions
BPO 44967
Nosy @ambv, @gpanders
PRs
  • bpo-44967: pydoc: return non-zero exit code when query is not found #27868
  • 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 2021-08-26.12:22:34.340>
    created_at = <Date 2021-08-21.03:22:27.007>
    labels = ['type-feature', '3.11']
    title = 'pydoc should return non-zero exit code when a query is not found'
    updated_at = <Date 2021-08-26.12:22:34.339>
    user = 'https://github.com/gpanders'

    bugs.python.org fields:

    activity = <Date 2021-08-26.12:22:34.339>
    actor = 'lukasz.langa'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-08-26.12:22:34.340>
    closer = 'lukasz.langa'
    components = ['Demos and Tools']
    creation = <Date 2021-08-21.03:22:27.007>
    creator = 'gpanders'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44967
    keywords = ['patch']
    message_count = 3.0
    messages = ['400012', '400339', '400340']
    nosy_count = 2.0
    nosy_names = ['lukasz.langa', 'gpanders']
    pr_nums = ['27868']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44967'
    versions = ['Python 3.11']

    Activity

    1. gpanders commented on Aug 21, 2021

      @gpanders
      gpandersmannequin
      on Aug 21, 2021
      MannequinAuthor
      More actions

      Currently pydoc returns an exit code of zero no matter what, even with e.g.

      pydoc lsjdfkdfj
      

      However, the ability to know whether or not pydoc successfully found a result is useful in tools that embed pydoc in some way.

      Here's one use case: Vim and Neovim have a feature that allows a user to run an external command for the keyword under the cursor (keywordprg). In Python files, this defaults to pydoc. In Neovim, we would like to automatically close the PTY buffers that we create for these processes when they finish without any errors, but if it returns a non-zero exit code we want to keep the PTY buffer open so the user can see what went wrong. Because pydoc returns immediately when it fails to find a match and does not indicate that it failed via a return code, the PTY buffer is closed immediately with no indication to the user that anything went wrong.

      I have a patch prepared for this that I will link to the issue.

    2. gpanders
      added
      type-featureA feature request or enhancementA feature request or enhancement
      on Aug 21, 2021
    3. ambv commented on Aug 26, 2021

      @ambv
      ambv
      on Aug 26, 2021
      Contributor
      More actions

      New changeset 8868d48 by Gregory Anders in branch 'main':
      bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868)
      8868d48

    4. ambv commented on Aug 26, 2021

      @ambv
      ambv
      on Aug 26, 2021
      Contributor
      More actions

      Thanks for the report and fix, Gregory! ✨ 🍰 ✨

    5. ambv
      added
      3.11only security fixesonly security fixes
      on Aug 26, 2021
    6. ambv
      closed this as completedon Aug 26, 2021
    7. ambv
      added
      3.11only security fixesonly security fixes
      on Aug 26, 2021
    8. ambv
      closed this as completedon Aug 26, 2021
    9. ezio-melotti
      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.11only security fixesonly security fixestype-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.