Skip to content

Commit ecd83e0

Browse files
StanFromIrelandpicnixzserhiy-storchaka
authored
gh-133439: Fix the error message in the sqlite3 CLI (GH-133807)
Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 9731dd2 commit ecd83e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/sqlite3/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
6363
if source[0] == ".":
6464
match source[1:].strip():
6565
case "version":
66-
print(f"{sqlite3.sqlite_version}")
66+
print(sqlite3.sqlite_version)
6767
case "help":
6868
print("Enter SQL code and press enter.")
6969
case "quit":
@@ -72,8 +72,8 @@ def runsource(self, source, filename="<input>", symbol="single"):
7272
pass
7373
case _ as unknown:
7474
t = theme.traceback
75-
self.write(f'{t.type}Error{t.reset}:{t.message} unknown'
76-
f'command or invalid arguments: "{unknown}".\n{t.reset}')
75+
self.write(f'{t.type}Error{t.reset}: {t.message}unknown '
76+
f'command: "{unknown}"{t.reset}\n')
7777
else:
7878
if not sqlite3.complete_statement(source):
7979
return True

Lib/test/test_sqlite3/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_interact_dot_commands_unknown(self):
138138
self.assertEndsWith(out, self.PS1)
139139
self.assertEqual(out.count(self.PS1), 2)
140140
self.assertEqual(out.count(self.PS2), 0)
141-
self.assertIn("Error", err)
141+
self.assertIn('Error: unknown command: "', err)
142142
# test "unknown_command" is pointed out in the error message
143143
self.assertIn("unknown_command", err)
144144

0 commit comments

Comments
 (0)