[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

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

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8868d48712aee2b490efaf60bed8dfe9fb14d6b7 by Gregory Anders in 
branch 'main':
bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868)
https://github.com/python/cpython/commit/8868d48712aee2b490efaf60bed8dfe9fb14d6b7


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-20 Thread Gregory Anders


Change by Gregory Anders :


--
keywords: +patch
pull_requests: +26323
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27868

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-20 Thread Gregory Anders


New submission from Gregory Anders :

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.

--
components: Demos and Tools
messages: 400012
nosy: gpanders
priority: normal
severity: normal
status: open
title: pydoc should return non-zero exit code when a query is not found
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com