Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[3.14] gh-133439: Fix the error message in the sqlite3 CLI (GH-133807)
(cherry picked from commit ecd83e0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
3 people committed Jun 19, 2025
commit 33531dd70e9bcbb639f122cda80060d17f2205fa
5 changes: 2 additions & 3 deletions Lib/sqlite3/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,15 @@ def runsource(self, source, filename="<input>", symbol="single"):
if source[0] == ".":
match source[1:].strip():
case "version":
print(f"{sqlite3.sqlite_version}")
print(sqlite3.sqlite_version)
case "help":
print("Enter SQL code and press enter.")
case "quit":
sys.exit(0)
case "":
pass
case _ as unknown:
self.write("Error: unknown command or invalid arguments:"
f' "{unknown}".\n')
self.write(f'Error: unknown command: "{unknown}"\n')
else:
if not sqlite3.complete_statement(source):
return True
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_sqlite3/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_interact_dot_commands_unknown(self):
self.assertEndsWith(out, self.PS1)
self.assertEqual(out.count(self.PS1), 2)
self.assertEqual(out.count(self.PS2), 0)
self.assertIn("Error", err)
self.assertIn('Error: unknown command: "', err)
# test "unknown_command" is pointed out in the error message
self.assertIn("unknown_command", err)

Expand Down
Loading