Visitar URL original
gh-102541: Hide traceback in help prompt by Eclips4 · Pull Request #102614 · python/cpython · GitHub
Skip to content

gh-102541: Hide traceback in help prompt - #102614

Merged
corona10 merged 2 commits into
python:mainfrom
Eclips4:issue-102541
Jun 14, 2023
Merged

corona10 merged 2 commits into
python:mainfrom
Eclips4:issue-102541

Conversation

@Eclips4

@Eclips4 Eclips4 commented Mar 11, 2023 •

Copy link
Copy Markdown
Member

Add is_cli param to doc function (by default, set to False).
When is_cli arg is True, we raise a ImportError, otherwise, just show a missing_pattern.
Although, add a variable missing_pattern, which now is used by resolve and doc functions.
This PR absolutely compatible with #89130.
I like tests, but i think, that case shouldn't be tested.
If core-devs approve this, it should be merged to 3.11 and 3.12 branches.
On 3.10 this works fine.

@Eclips4

Eclips4 commented Mar 13, 2023

Copy link
Copy Markdown
Member Author

Could someone review it? =)

Comment thread Lib/pydoc.py Outdated
@Eclips4

Eclips4 commented Mar 17, 2023

Copy link
Copy Markdown
Member Author

@sobolevn
Can you review it?

@arhadthedev arhadthedev added the stdlib Standard Library Python modules in the Lib/ directory label Mar 22, 2023
@Eclips4

Eclips4 commented May 14, 2023

Copy link
Copy Markdown
Member Author

Can someone from core developers review it?

@terryjreedy
terryjreedy requested a review from ambv June 12, 2023 17:50
@terryjreedy terryjreedy added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jun 12, 2023
@terryjreedy
terryjreedy requested a review from corona10 June 12, 2023 18:43
@terryjreedy

terryjreedy commented Jun 12, 2023 •

Copy link
Copy Markdown
Member

The most appropriate coredev reviewer would be whoever merged the PR that caused the regression. That would have to be a feature addition after 3.10.0b1, May 2021 (and hence not backported to 3.10) and before 3.11.0 in Oct 2022. #98450 fixed a related bug -- help('invalid query') raising with similar result. This caught the exception in a different place (line 2005) and remains fixed.

help need more automated tests.

@corona10

Copy link
Copy Markdown
Member

I will take a look at this PR tonight (UTC+9)

Comment thread Lib/pydoc.py

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with nit comment.
Writing test code will be great, but I know this case is very hard to write. :)

@corona10

Copy link
Copy Markdown
Member

Please rebase the PR.

Comment thread Misc/NEWS.d/next/Library/2023-03-12-01-17-15.gh-issue-102541.LK1adc.rst Outdated
@corona10
corona10 merged commit ba516e7 into python:main Jun 14, 2023
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @Eclips4 for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @Eclips4 and @corona10, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker ba516e70c6d156dc59dede35b6fc3db0151780a5 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 14, 2023
(cherry picked from commit ba516e7)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@bedevere-bot

Copy link
Copy Markdown

GH-105778 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jun 14, 2023
corona10 pushed a commit that referenced this pull request Jun 15, 2023
gh-102541: Hide traceback in help prompt (gh-102614)
(cherry picked from commit ba516e7)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@bedevere-bot

Copy link
Copy Markdown

GH-105830 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jun 15, 2023
corona10 pushed a commit to corona10/cpython that referenced this pull request Jun 15, 2023
(cherry picked from commit ba516e7)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
corona10 added a commit that referenced this pull request Jun 15, 2023
(cherry picked from commit ba516e7)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@Eclips4
Eclips4 deleted the issue-102541 branch June 19, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stdlib Standard Library Python modules in the Lib/ directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants