New submission from Ronan Pigott <rpig...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue39400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to