-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Add MANPAGER envvar to specify pager for pydoc #52883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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 |
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. |
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. |
Is there a standard documenting MANPAGER somewhere? |
On Thu, Feb 3, 2011 at 7:09 PM, Éric Araujo <report@bugs.python.org> wrote:
Not really a standard, but man page for man on my OSX laptop says: """ POSIX only mandates PAGER. See As I said before, since pydoc is not man, if we want a pydoc-specific |
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? |
On Thu, Feb 3, 2011 at 7:39 PM, Éric Araujo <report@bugs.python.org> wrote:
I may know the answer to this one. A common PAGER setting is "less |
On Thu, Feb 3, 2011 at 7:39 PM, Éric Araujo <report@bugs.python.org> wrote:
vimpager is the one I'm using. For man pages there's vimmanpager. |
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. |
Reusing MANPAGER is practical. Yet another PY* environment variable doesn't seem warranted in this case. |
In headers with vimpager ^H is not rendered(?) correctly. For instance, 'pydoc os' shows: --- N^HNA^HAM^HME^HE F^HFI^HIL^HLE^HE --- And so on. |
adding MANPAGER, with the simpler logic. |
New changeset 820d21c97d66 by doko in branch 'default':
|
fixed for 3.6.0a3 |
Matthias: your change causes pydoc to raise KeyError if I set MANPAGER but not PAGER. I’m guessing you intended something else? |
New changeset dea9f9b5582b by doko in branch 'default':
|
sorry, updated. |
Thanks, that version looks more sensible |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: