[New-bugs-announce] [issue39400] pydoc: Use of MANPAGER variable is incorrect

Ronan Pigott report at bugs.python.org
Mon Jan 20 16:02:23 EST 2020


New submission from Ronan Pigott <rpigott at berkeley.edu>:

pydoc references the value of both MANPAGER and PAGER variables when selecting a command to present the user with documentation. Those values are passed directly to subprocess.Popen. However, MANPAGER may contain arguments that need splitting, and is explicitly documented as such in the `man 1 man` manpage:

> If $MANPAGER or $PAGER is set ($MANPAGER is used in preference), its value is used as the name of the program used to display the manual page. [...] The value may be a simple command name or a command with arguments, and may  use  shell quoting (backslashes,  single quotes, or double quotes). It may not use pipes to connect multiple commands; if you need that, use a wrapper script [...]

pydoc should perform word splitting a la shlex.split on the values of MANPAGER and PAGER to retain compatibility with man.

----------
components: Library (Lib)
messages: 360332
nosy: Brocellous
priority: normal
severity: normal
status: open
title: pydoc: Use of MANPAGER variable is incorrect
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39400>
_______________________________________


More information about the New-bugs-announce mailing list