-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
quit() and exit() don't work in interactive help #112007
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Working as expected on macOS, installed using the "macOS 64-bit universal2 installer" from https://www.python.org/downloads/release/python-3130a1/ ❯ python3.13
Python 3.13.0a1 (v3.13.0a1:ad056f03ae, Oct 13 2023, 06:35:05) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
❯ python3.13
Python 3.13.0a1 (v3.13.0a1:ad056f03ae, Oct 13 2023, 06:35:05) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
❯ python3.13
Python 3.13.0a1 (v3.13.0a1:ad056f03ae, Oct 13 2023, 06:35:05) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
❯ python3.13
Python 3.13.0a1 (v3.13.0a1:ad056f03ae, Oct 13 2023, 06:35:05) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
[1] + 65866 suspended python3.13 Also built from latest ❯ ./python.exe
Python 3.13.0a1+ (heads/main:b2af50cb02, Nov 12 2023, 18:24:40) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
❯ ./python.exe
Python 3.13.0a1+ (heads/main:b2af50cb02, Nov 12 2023, 18:24:40) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
❯ ./python.exe
Python 3.13.0a1+ (heads/main:b2af50cb02, Nov 12 2023, 18:24:40) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
❯ ./python.exe
Python 3.13.0a1+ (heads/main:b2af50cb02, Nov 12 2023, 18:24:40) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
[2] + 65953 suspended ./python.exe |
But this bit is interesting, have you run Do you have the |
It works for me. Both shell and IDLE Windows 11 Home |
@catafest Exactly what Windows are you using? |
The title was wrong and misleading. The correct title is "quit() and exit() don't work on interactive help". And this is right. When you enter an interactive help, you get a long introduction message that includes: |
This isn't version or platform specific. As Serhiy mentioned, there's no bug here from the perspective of an understanding of the code. However, it does strike me as being new user unfriendly, and we may want to improve it. There's an easy fix: just add |
Most important: move how-to-quit sentence to the end.
I think that this sentence, 'To quit this help utility and return to the interpreter, just type "quit".' in pydoc.Helper.intro should be moved to the end after a blank line. It is now in the middle of things to do other than quitting. I suspect that it was once the last sentence before more was added. I will submit a PR with this and a couple of other re-groupings. |
To me, changing this string in the pydoc module is equivalent to a doc change and should be backported. test_pydoc still passes as is, and I don't think anyone else should depend on the exact content. Any disagreement? |
I added 'q' as an alternative. I had not idea that it worked until I read the code quoted above by 'zware'. |
Most important: move how-to-quit sentence to the end and mention 'q'. Re-group the other sentences and improve some wording. --------- Co-authored-by: Hugo van Kemenade <[email protected]>
) Most important: move how-to-quit sentence to the end and mention 'q'. Re-group the other sentences and improve some wording. --------- Co-authored-by: Hugo van Kemenade <[email protected]> (cherry picked from commit b28bb13) Co-authored-by: Terry Jan Reedy <[email protected]>
) Most important: move how-to-quit sentence to the end and mention 'q'. Re-group the other sentences and improve some wording. --------- Co-authored-by: Hugo van Kemenade <[email protected]> (cherry picked from commit b28bb13) Co-authored-by: Terry Jan Reedy <[email protected]>
…112048) gh-112007: Re-organize help utility intro message (GH-112017) Most important: move how-to-quit sentence to the end and mention 'q'. Re-group the other sentences and improve some wording. --------- (cherry picked from commit b28bb13) Co-authored-by: Terry Jan Reedy <[email protected]>
…112047) gh-112007: Re-organize help utility intro message (GH-112017) Most important: move how-to-quit sentence to the end and mention 'q'. Re-group the other sentences and improve some wording. --------- (cherry picked from commit b28bb13) Co-authored-by: Terry Jan Reedy <[email protected]>
I think that this revision should be sufficient for now. The previously not mentioned 'q', now easy to see, is the easiest way to exit. |
Most important: move how-to-quit sentence to the end and mention 'q'. Re-group the other sentences and improve some wording. --------- Co-authored-by: Hugo van Kemenade <[email protected]>
Most important: move how-to-quit sentence to the end and mention 'q'. Re-group the other sentences and improve some wording. --------- Co-authored-by: Hugo van Kemenade <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
I tried to use quit and exit to return to the interactive Python shell but these not work. I need to use Ctr +Z.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: