Repository navigation
help CLI shows a traceback when import failed #102541
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancement
on Mar 8, 2023 - addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.10 (EOL)end of lifeend of lifeand removedtype-featureA feature request or enhancementA feature request or enhancement
on Mar 8, 2023 I verified above in 3.11.2 and 3.12.0a6. 3.10.10 is better -- Gives import error message without traceback. But even better would be to give error message without
ImportErrorand return tohelp>prompt. This should possibly be a separate PR as there might be more discussion that change. (It is possible that 3.11 change is intentional -- this should be checked.)How I understand, it's introduced in #89130.
Yeah, i found right way to fix it. I I have slightly changed signature of some functions, which now have argument
is_cli(set default toFalse).
That's doesn't break compatibility with issue which i mentioned above.
Currenly, inhelpprompt errors looks like that:help> abd No Python documentation found for 'abd'. Use help() to get the interactive help utility. Use help(str) for help on the str class. help>
@terryjreedy What you think about this?
BTW, all tests are passed.
I think, error message we should change, any ideas? (this will make us to change some lines intest_pydoc, but it's not hard)- added a commit that references this issue
on Mar 11, 2023 @terryjreedy
I think there's no need to backport it to 3.10 branch. I cannot reproduce it thereIn closed duplicate #105702, I noted that there was no bug in latest release of 3.8, 3.9, or 3.10. Patch should restore previous behavior, shown on that issue, which is same as shown above. I just installed 32-bit 3.11.0 and it does have the bug. Will look at PR.
Reacted by Kirill PodoprigoraIn closed duplicate #105702, I noted that there was no bug in latest release of 3.8, 3.9, or 3.10. Patch should restore previous behavior, shown on that issue, which is same as shown above. I just installed 32-bit 3.11.0 and it does have the bug. Will look at PR.
Yeah, so, please, delete label
3.10on this issue, and add 3.13 label, this still reproducible on current main- added3.13only security fixesonly security fixesand removed3.10 (EOL)end of lifeend of life
on Jun 12, 2023 21 remaining items
Okay, so now it's just about adding the last test case, right? 😅
Okay, so now it's just about adding the last test case, right? 😅
Yeah, you're right.
I already sent a PR to add this, and waiting for review.I reviewed and edited and intend to merge and close this after CI passes.
Thank you very much @terryjreedy for your help!
Now, all PR's merged and backported.
Everything that needed to be done was done.
Again, thanks Terry for his thorough help.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Currently,
helpwill show a traceback when we type name of something which doesn't exist:I think, this shouldn't be shown.
Is there any reason for this?
Can we show something like
No python documentation found for '123'.?Reproducible on current main.
Linked PRs