Repository navigation
gh-161039: fix detection of less >= 706 in _pyrepl/pager.py - #161040
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
This could be handled in various ways. Using |
…_pager` Since less tag v706¹, less exits with a failure status when no filename is provided. Pass the `-?` option and redirect both stdout and stderr to /dev/null. Failure to detect `less` results in using `more` for users who don't have MANPAGER or PAGER set, which is unexpected. ¹ gwsw/less@7c85230 (Exit with a failure status in more cases, 2026-06-14)
72a8316 to
67fb193
Compare
|
Apparently, I should not have bothered adding a NEWS snippet after the initial feedback from the bot. Or at the least, I don't know enough about the syntax to write one that passes the doc checks. If someone can offer advice on fixing whatever is wrong with the snippet or whether it's even needed for the simple code fix, I'll happily change it either way. |
|
I pushed a little change to test with |
Thanks! I can update the commit message to match, if that level of consistency is important to anyone. Indeed it's better to avoid (I did wonder why FWIW, I checked the |
|
Thanks @tmzullinger for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
Merged, thanks!
I presume the pager predates Hmm, I'll try backporting again tomorrow, the bot seems to be down. |
|
Thanks @tmzullinger for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Thanks @tmzullinger for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-161148 is a backport of this pull request to the 3.15 branch. |
|
Thanks @tmzullinger for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
GH-161149 is a backport of this pull request to the 3.14 branch. |
Since less tag v706¹, less exits with a failure status when no filename is provided. Pass the
-?option and redirect both stdout and stderr to /dev/null.Failure to detect
lessresults in usingmorefor users who don't have MANPAGER or PAGER set, which is unexpected.¹ gwsw/less@7c85230 (Exit with a failure
status in more cases, 2026-06-14)