Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-37755: Use configured output in pydoc instead of pager#15105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
serhiy-storchaka merged 4 commits intopython:mainfromeht16:issue37755_pydoc_pager
Jun 8, 2024

Conversation

@eht16
Copy link
Contributor

@eht16eht16 commentedAug 4, 2019
edited by bedevere-bot
Loading

If the Helper() class was initialized with an output, the topics, keywords and symbols help still use the pager instead of the output.
Change the behavior so the output is used if available while keeping the previous behavior if no output was configured.

https://bugs.python.org/issue37755

@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed thePSF contributor agreement (CLA).

Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please followthe steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You cancheck yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please add tests and a NEWS entry.

@bedevere-app
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@eht16eht16force-pushed theissue37755_pydoc_pager branch from0bb4ee6 to910baaeCompareJune 2, 2024 11:29
@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@eht16eht16force-pushed theissue37755_pydoc_pager branch from910baae toc1254eaCompareJune 2, 2024 11:43
If the Helper() class was initialized with an output, the topics, keywords and symbols help still use the pager instead of the output.Change the behavior so  the output is used if available while keeping the previous behavior if no output was configured.
@eht16eht16force-pushed theissue37755_pydoc_pager branch fromc1254ea to207a962CompareJune 2, 2024 11:48
@eht16
Copy link
ContributorAuthor

I have made the requested changes; please review again

Though I'm not sure why the Docs action fail, I don't see how the references are incorrect.

@bedevere-app
Copy link

Thanks for making the requested changes!

@serhiy-storchaka: please review the changes made to this pull request.

Comment on lines 719 to 720
pydoc.getpager=getpager_new
try:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You can usetest.support.swap_attr() orunittest.mock.patch().

It would be nice to test also that the pager was not called (otherwise why do you need to patch it?).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good idea, done.

I modified also the existing testtest_help_output_redirect from which I borrowed the "getpager" handling code. To me it also seems more reasonable to use mocking here.

eht16and others added2 commitsJune 2, 2024 18:24
…1936.ETeW9x.rstCo-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Very good. But it seems thatgetpager() is never called inpydoc, so mocking it does not have effect. Should not you mockpager?

@eht16
Copy link
ContributorAuthor

Very good. But it seems thatgetpager() is never called inpydoc, so mocking it does not have effect. Should not you mockpager?

Oops, thanks for noticing. I thoughtgetpager() get called indirectly viapager() but anyway, it is better to mock thepager() function directly.

I'd like to squash the "fixup" commits or do you want to it yourself on merging?

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM.

Usually we only squash on merging.

eht16 reacted with heart emoji
@miss-islington-app
Copy link

Thanks@eht16 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 8, 2024
…15105)If the Helper() class was initialized with an output, the topics, keywordsand symbols help still use the pager instead of the output.Change the behavior so  the output is used if available while keeping theprevious behavior if no output was configured.(cherry picked from commit2080425)Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
@miss-islington-app
Copy link

Sorry,@eht16 and@serhiy-storchaka, I could not cleanly backport this to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 2080425154d235b4b7dcc9a8a2f58e71769125ca 3.12

@bedevere-app
Copy link

GH-120261 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJun 8, 2024
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull requestJun 8, 2024
…thonGH-15105)If the Helper() class was initialized with an output, the topics, keywordsand symbols help still use the pager instead of the output.Change the behavior so  the output is used if available while keeping theprevious behavior if no output was configured.(cherry picked from commit2080425)Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
@bedevere-app
Copy link

GH-120262 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelJun 8, 2024
@eht16eht16 deleted the issue37755_pydoc_pager branchJune 8, 2024 09:41
serhiy-storchaka added a commit that referenced this pull requestJun 8, 2024
…-15105) (GH-120262)If the Helper() class was initialized with an output, the topics, keywordsand symbols help still use the pager instead of the output.Change the behavior so  the output is used if available while keeping theprevious behavior if no output was configured.(cherry picked from commit2080425)Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
serhiy-storchaka pushed a commit that referenced this pull requestJun 8, 2024
…-15105) (GH-120261)If the Helper() class was initialized with an output, the topics, keywordsand symbols help still use the pager instead of the output.Change the behavior so  the output is used if available while keeping theprevious behavior if no output was configured.(cherry picked from commit2080425)Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull requestJul 11, 2024
…15105)If the Helper() class was initialized with an output, the topics, keywordsand symbols help still use the pager instead of the output.Change the behavior so  the output is used if available while keeping theprevious behavior if no output was configured.
estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
…15105)If the Helper() class was initialized with an output, the topics, keywordsand symbols help still use the pager instead of the output.Change the behavior so  the output is used if available while keeping theprevious behavior if no output was configured.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@eht16@the-knights-who-say-ni@serhiy-storchaka@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp