Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

tanloong
Copy link
Contributor

@tanloongtanloong commentedMay 5, 2025
edited by bedevere-appbot
Loading

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a 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.

@tanloongtanloongforce-pushed thesqlite3-cli-strip-whitespaces branch from0d89da8 to3543c33CompareMay 9, 2025 08:19
@tanloong
Copy link
ContributorAuthor

Thank you for your review! I have modified the code to usesource[1:].strip() as dot command, no stripping for SQL statement.

@tanloongtanloongforce-pushed thesqlite3-cli-strip-whitespaces branch from3543c33 toa4498abCompareMay 9, 2025 08:24
@tanloongtanloongforce-pushed thesqlite3-cli-strip-whitespaces branch fromcbea2b1 to487aafcCompareMay 9, 2025 09:50
@tanloongtanloongforce-pushed thesqlite3-cli-strip-whitespaces branch from487aafc tob473fe9CompareMay 9, 2025 09:52
@tanloong
Copy link
ContributorAuthor

Sorry for the overlook, now the empty source and unknown dot commands are handled. I have improved the news entry.

@tanloongtanloongforce-pushed thesqlite3-cli-strip-whitespaces branch from36b4a16 tocaf47bcCompareMay 9, 2025 11:07
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. 👍

tanloong reacted with heart emoji
@serhiy-storchakaserhiy-storchakaenabled auto-merge (squash)May 9, 2025 11:11
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 9, 2025
auto-merge was automatically disabledMay 9, 2025 11:13

Head branch was pushed to by a user without write access

@serhiy-storchakaserhiy-storchakaenabled auto-merge (squash)May 9, 2025 11:15
@serhiy-storchakaserhiy-storchaka merged commitebd4881 intopython:mainMay 9, 2025
39 checks passed
@miss-islington-app
Copy link

Thanks@tanloong for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 9, 2025
…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>
@bedevere-app
Copy link

GH-133738 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMay 9, 2025
@picnixz
Copy link
Member

@serhiy-storchaka no 3.13 backports?

serhiy-storchaka pushed a commit that referenced this pull requestMay 9, 2025
…for multi-line sqlite statements in the sqlite3 command-line interface (GH-133440) (GH-133738)(cherry picked from commitebd4881)Co-authored-by: Tan Long <tanloong@foxmail.com>
@serhiy-storchaka
Copy link
Member

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
Copy link
ContributorAuthor

I will do that.

@bedevere-app
Copy link

GH-133765 is a backport of this pull request to the3.13 branch.

@serhiy-storchaka
Copy link
Member

@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
Copy link
ContributorAuthor

Ah, sorry, I misunderstood.

tanloong added a commit to tanloong/cpython that referenced this pull requestMay 9, 2025
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440)(cherry picked from commitebd4881)
pass
case _ as unknown:
self.write("Error: unknown command or invalid arguments:"
f' "{unknown}".\n')
Copy link
Contributor

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz left review comments

@erlend-aaslanderlend-aaslanderlend-aasland left review comments

@StanFromIrelandStanFromIrelandStanFromIreland left review comments

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

@berkerpeksagberkerpeksagAwaiting requested review from berkerpeksagberkerpeksag is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@tanloong@picnixz@serhiy-storchaka@erlend-aasland@StanFromIreland

[8]ページ先頭

©2009-2025 Movatter.jp