Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
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 our terms of service and privacy 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
tanloong commented May 5, 2025 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
d756211 to 0d89da8Compare
serhiy-storchaka left a comment
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.
The sqlite3 CLI supports also space after dot:
sqlite> . version SQLite 3.45.1 2024-01-30 16:01:20 e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257ccalt1 zlib version 1.3 gcc-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, use source[1:].strip() as the command. No stripping is needed for the SQL statement.
0d89da8 to 3543c33Comparetanloong commented May 9, 2025
Thank you for your review! I have modified the code to use |
3543c33 to a4498abCompareUh 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 Outdated Show resolvedHide resolved
Uh oh!
There was an error while loading. Please reload this page.
cbea2b1 to 487aafcCompare487aafc to b473fe9Comparetanloong commented May 9, 2025
Sorry 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 to caf47bcCompare
serhiy-storchaka left a comment
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.
LGTM. 👍
Head branch was pushed to by a user without write access
ebd4881 into python: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 commit ebd4881) Co-authored-by: Tan Long <[email protected]>
GH-133738 is a backport of this pull request to the 3.14 branch. |
picnixz commented May 9, 2025
@serhiy-storchaka no 3.13 backports? |
…for multi-line sqlite statements in the sqlite3 command-line interface (GH-133440) (GH-133738) (cherry picked from commit ebd4881) Co-authored-by: Tan Long <[email protected]>
serhiy-storchaka commented May 9, 2025
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. |
tanloong commented May 9, 2025
I will do that. |
GH-133765 is a backport of this pull request to the 3.13 branch. |
serhiy-storchaka commented May 9, 2025
@tanloong, I meant any of the core developers. It's as simple as adding a label. Someone just has to want to do it. |
tanloong commented May 9, 2025
Ah, sorry, I misunderstood. |
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440) (cherry picked from commit ebd4881)
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 linux Type "help", "copyright", "credits" or "license" for more information. >>> test Traceback (most recent call last): File "<python-input-0>", line 1, in <module> test NameError: name 'test' is not defined …or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440)
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440)
Issue: sqlite3 CLI does not recognize dot commands with trailing spaces #133439