Skip to content

Prompt text in sqlite3 CLI (new in 3.12) is Linux oriented and doesn't apply to Windows #102628

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

Closed
Dutcho opened this issue Mar 12, 2023 · 3 comments · Fixed by #103898 or #103945
Closed
Assignees
Labels
3.12 only security fixes OS-windows topic-IDLE topic-sqlite3 type-bug An unexpected behavior, bug, or error

Comments

@Dutcho
Copy link

Dutcho commented Mar 12, 2023

Bug report

The command line command python3.12 -m sqlite3 gives a prompt stating "[...]Type ".help" for more information; type ".quit" or CTRL-D to quit."
But on Windows, the Unixism CTRL-D doesn't work (instead, and after adding ";" and "ENTER", it reports: "OperationalError (SQLITE_ERROR): unrecognized token: "♦"" ); CTRL-Z does work on Windows (but not on Linux, I guess).

Request to clarify the prompt.

Environment

  • CPython: Python 3.12.0a6 (tags/v3.12.0a6:f9774e5, Mar 7 2023, 23:52:43) [MSC v.1934 64 bit (AMD64)]
  • Operating system: MS Windows 3.11 Pro
  • Architecture: Intel i5

Linked PRs

@Dutcho Dutcho added the type-bug An unexpected behavior, bug, or error label Mar 12, 2023
@terryjreedy
Copy link
Member

terryjreedy commented Mar 12, 2023

I corrected sqlite to sqlite3 in the startup command. ^Z must be followed by to exit, but windows users should know that.

CTRL-D is in sqlite3.__main__ in the 'banner' f-string. To fix, replace D with {exitchar} and define exitchar above the banner assignment. I may do it later.

EDIT: A complication is that ^D is correct for IDLE even on Windows. I have no idea what would be correct for other IDEs.

@erlend-aasland erlend-aasland self-assigned this Mar 22, 2023
@erlend-aasland
Copy link
Contributor

Perhaps the easiest thing to do would be to adjust the banner depending on which platform we're running on. For *nix, we can recommend CTRL-D, for Windows, we can recommend CTRL-Z.

@erlend-aasland erlend-aasland moved this to TODO: Bugs in sqlite3 issues Mar 28, 2023
erlend-aasland added a commit to erlend-aasland/cpython that referenced this issue Apr 26, 2023
CTRL-Z is the Windows equivalent of CTRL-D.
@erlend-aasland erlend-aasland moved this from TODO: Bugs to In Progress in sqlite3 issues Apr 26, 2023
@erlend-aasland erlend-aasland linked a pull request Apr 26, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in sqlite3 issues Apr 27, 2023
erlend-aasland added a commit that referenced this issue Apr 27, 2023
The prompt will still be incorrect in IDLE on Windows,
as IDLE uses CTRL-D for EOF on all platforms.
@erlend-aasland
Copy link
Contributor

erlend-aasland commented Apr 27, 2023

Reopening, as the prompt is still incorrect in IDLE on Windows.

See #103898 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes OS-windows topic-IDLE topic-sqlite3 type-bug An unexpected behavior, bug, or error
Projects
Status: Done
4 participants