Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
gh-133439: Fix dot commands with trailing spaces are mistaken for multi-line sqlite statements in the sqlite3 command-line interface#133440
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d756211
to0d89da8
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The sqlite3 CLI supports also space after dot:
sqlite> . versionSQLite 3.45.1 2024-01-30 16:01:20 e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257ccalt1zlib version 1.3gcc-13.3.0 (64-bit)
But not before dot:
sqlite> .version ...>
To be conforming with it, we should check if the first character is a dot, and if it is, usesource[1:].strip()
as the command. No stripping is needed for the SQL statement.
0d89da8
to3543c33
CompareThank you for your review! I have modified the code to use |
3543c33
toa4498ab
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-05-05-22-11-24.gh-issue-133439.LpmyFz.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
cbea2b1
to487aafc
Compare487aafc
tob473fe9
CompareSorry for the overlook, now the empty source and unknown dot commands are handled. I have improved the news entry. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
36b4a16
tocaf47bc
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. 👍
Head branch was pushed to by a user without write access
ebd4881
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@tanloong for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440)(cherry picked from commitebd4881)Co-authored-by: Tan Long <tanloong@foxmail.com>
GH-133738 is a backport of this pull request to the3.14 branch. |
@serhiy-storchaka no 3.13 backports? |
This is borderline between minor bug fix and minor feature. It improves the quality of life a little, but most people won't notice anything. If anyone wants to backport to 3.13, please do. If not, no problem either. |
I will do that. |
GH-133765 is a backport of this pull request to the3.13 branch. |
@tanloong, I meant any of the core developers. It's as simple as adding a label. Someone just has to want to do it. |
Ah, sorry, I misunderstood. |
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440)(cherry picked from commitebd4881)
Uh oh!
There was an error while loading.Please reload this page.
pass | ||
case _ as unknown: | ||
self.write("Error: unknown command or invalid arguments:" | ||
f' "{unknown}".\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Error messages do not end with a '.' e.g.:
Python 3.15.0a0 (heads/main:c81fa2b9cd1, May 8 2025, 16:38:25) [GCC 15.1.1 20250425 (Red Hat 15.1.1-1)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> testTraceback (most recent call last): File "<python-input-0>", line 1, in <module> testNameError: name 'test' is not defined
Uh oh!
There was an error while loading.Please reload this page.
Issue:sqlite3 CLI does not recognize dot commands with trailing spaces #133439