Issue 8637: Add MANPAGER envvar to specify pager for pydoc (original) (raw)

Created on 2010-05-06 15:33 by jsbronder, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-2.7-pydoc-manpager.patch jsbronder,2010-05-06 15:33
Messages (18)
msg105151 - (view) Author: Justin Bronder (jsbronder) * Date: 2010-05-06 15:33
Similar to man(1), pydoc should respect the environment variable MANPAGER over PAGER. The current behavior causes issues when using a PAGER that does not support man pages. Patch based off of trunk, r80871
msg105153 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-05-06 18:06
Similar logic can be written simpler as use_pager = os.environ.get('MANPAGER') or os.environ.get('PAGER') if use_pager: ... (yes, I think ignoring empty *PAGER is preferable to an error) I am not sure, pydoc should respect MANPAGER. Why not PYDOCPAGER? In any case this is a feature request rather than a bug.
msg105154 - (view) Author: Justin Bronder (jsbronder) * Date: 2010-05-06 18:15
I chose MANPAGER as the command line pydoc utility already clones some of the man functionality, but I'm fine with PYDOCPAGER or anything else that allows me to use pydoc without having to change PAGER first.
msg127833 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 00:09
Is there a standard documenting MANPAGER somewhere?
msg127836 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-02-04 00:15
On Thu, Feb 3, 2011 at 7:09 PM, Éric Araujo <report@bugs.python.org> wrote: > > Éric Araujo <merwok@netwok.org> added the comment: > > Is there a standard documenting MANPAGER somewhere? > Not really a standard, but man page for man on my OSX laptop says: """ -P pager Specify which pager to use. This option overrides the MANPAGER environment variable, which in turn overrides the PAGER variable. """ POSIX only mandates PAGER. See <http://pubs.opengroup.org/onlinepubs/007908799/xcu/man.html>. As I said before, since pydoc is not man, if we want a pydoc-specific variable to override PAGER, it should be callled PYDOCPAGER.
msg127841 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 00:39
My man(1) also respects MANPAGER (it’s the one from http://man-db.nongnu.org/), but given the lack of a standard, I agree with you. However, I’m reluctant to add another env variable. There are workarounds, for example using a shell alias like “docpy="PAGER=most pydoc"”. I think this warrants a python-ideas discussion. Justin: what exactly is a pager that does not support man pages?
msg127843 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-02-04 00:51
On Thu, Feb 3, 2011 at 7:39 PM, Éric Araujo <report@bugs.python.org> wrote: .. > Justin: what exactly is a pager that does not support man pages? I may know the answer to this one. A common PAGER setting is "less -rs" which makes less skip whitespace lines and passes through terminal control chars. Nether of these options are needed for pydoc, but I don't know if they cause any harm.
msg128122 - (view) Author: Justin Bronder (jsbronder) * Date: 2011-02-07 15:24
On Thu, Feb 3, 2011 at 7:39 PM, Éric Araujo <report@bugs.python.org> wrote: .. > Justin: what exactly is a pager that does not support man pages? vimpager is the one I'm using. For man pages there's vimmanpager.
msg128123 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-07 15:27
Excuse me if I was unclear: I wasn’t asking for program names but for a definition of “don’t support” or description of problematic behavior.
msg128124 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-07 15:31
Reusing MANPAGER is practical. Yet another PY* environment variable doesn't seem warranted in this case. Agreed with Alexander's simpler logic proposal in .
msg128126 - (view) Author: Justin Bronder (jsbronder) * Date: 2011-02-07 15:35
> Éric Araujo <merwok@netwok.org> added the comment: > > Excuse me if I was unclear: I wasn’t asking for program names but for a definition of “don’t support” or description of problematic behavior. In headers with vimpager ^H is not rendered(?) correctly. For instance, 'pydoc os' shows: --- Help on module os: N^HNA^HAM^HME^HE F^HFI^HIL^HLE^HE /usr/lib/python2.6/os.py --- And so on.
msg268525 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2016-06-14 06:38
adding MANPAGER, with the simpler logic.
msg268526 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-14 06:39
New changeset 820d21c97d66 by doko in branch 'default': - Issue #8637: Honor a pager set by the env var MANPAGER (in preference to https://hg.python.org/cpython/rev/820d21c97d66
msg268527 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2016-06-14 06:40
fixed for 3.6.0a3
msg268529 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-06-14 06:55
Matthias: your change causes pydoc to raise KeyError if I set MANPAGER but not PAGER. I’m guessing you intended something else?
msg268532 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-14 07:04
New changeset dea9f9b5582b by doko in branch 'default': - Issue #8637: Honor a pager set by the env var MANPAGER (in preference to https://hg.python.org/cpython/rev/dea9f9b5582b
msg268533 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2016-06-14 07:04
sorry, updated.
msg268534 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-06-14 07:05
Thanks, that version looks more sensible
History
Date User Action Args
2022-04-11 14:57:00 admin set github: 52883
2016-06-14 07:05:47 martin.panter set messages: +
2016-06-14 07:04:33 doko set messages: +
2016-06-14 07:04:05 python-dev set messages: +
2016-06-14 06:55:45 martin.panter set nosy: + martin.pantermessages: + versions: + Python 3.6, - Python 3.3
2016-06-14 06:40:45 doko set status: open -> closedresolution: fixedmessages: +
2016-06-14 06:39:46 python-dev set nosy: + python-devmessages: +
2016-06-14 06:38:59 doko set nosy: + dokomessages: + title: Add PYDOCPAGER envvar to specify pager for pydoc -> Add MANPAGER envvar to specify pager for pydoc
2011-02-07 15:35:06 jsbronder set nosy:belopolsky, pitrou, eric.araujo, jsbrondermessages: +
2011-02-07 15:31:51 pitrou set nosy: + pitroumessages: +
2011-02-07 15:27:12 eric.araujo set nosy:belopolsky, eric.araujo, jsbrondermessages: +
2011-02-07 15:24:35 jsbronder set nosy:belopolsky, eric.araujo, jsbrondermessages: +
2011-02-04 00:51:48 belopolsky set nosy:belopolsky, eric.araujo, jsbrondermessages: +
2011-02-04 00:39:31 eric.araujo set nosy:belopolsky, eric.araujo, jsbrondertitle: pydoc should respect MANPAGER over PAGER. -> Add PYDOCPAGER envvar to specify pager for pydocmessages: + stage: test needed ->
2011-02-04 00:15:37 belopolsky set nosy:belopolsky, eric.araujo, jsbrondermessages: +
2011-02-04 00:09:28 eric.araujo set nosy: + eric.araujomessages: + versions: + Python 3.3, - Python 2.7
2010-05-06 18:15:59 jsbronder set messages: +
2010-05-06 18:06:09 belopolsky set type: behavior -> enhancementmessages: + nosy: + belopolsky
2010-05-06 15:39:12 brian.curtin set title: [PATCH] pydoc should respect MANPAGER over PAGER. -> pydoc should respect MANPAGER over PAGER.stage: test needed
2010-05-06 15:33:45 jsbronder create