one set by the env var PAGER).
return plainpager
if not sys.stdin.isatty() or not sys.stdout.isatty():
return plainpager
- if 'PAGER' in os.environ:
+ use_pager = os.environ.get('MANPAGER') or os.environ.get('PAGER')
+ if use_pager:
if sys.platform == 'win32': # pipes completely broken in Windows
return lambda text: tempfilepager(plain(text), os.environ['PAGER'])
elif os.environ.get('TERM') in ('dumb', 'emacs'):
Library
-------
+- Issue #8637: Honor a pager set by the env var MANPAGER (in preference to
+ one set by the env var PAGER).
+
- Issue #22636: Avoid shell injection problems with
ctypes.util.find_library().