[issue39400] pydoc: Use of MANPAGER variable is incorrect

Ronan Pigott report at bugs.python.org
Mon Jan 20 16:49:43 EST 2020


Ronan Pigott <rpigott at berkeley.edu> added the comment:

Actually my previous comment is incorrect, the value of the PAGER is split with the shell as a result of shell=True. There _is_ still an incompatibility with man.

I have a value for MANPAGER set like 'env LESS_TERMCAP_mb=^[[01;31m ... less' which becomes split on ';' by the shell as a result of 'shell=True'. The MANPAGER value is not interpreted by a shell with man, so it works as expected when using man.

Becuase man explicitly allows the use of quotes, it is possible to set a value of MANPAGER that has the desired effect for both programs by quoting the terminal control sequences like so: 'env LESS="^[[01;31m ... less"'.

Still, it might be reasonable to change pydocs interpretation of MANPAGER to better align with man's.

----------

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


More information about the Python-bugs-list mailing list