Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.3k
gh-133439: Fix the error message in the sqlite3 CLI#133807
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.
Changes from4 commits
6b59a0b
6980619
6cb0432
1c6cf80
97d002d
c2ed7f1
7170ad9
fed7c0a
e8fde8d
4dcd379
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -61,7 +61,7 @@ def runsource(self, source, filename="<input>", symbol="single"): | ||||||
if source[0] == ".": | ||||||
match source[1:].strip(): | ||||||
case "version": | ||||||
print(sqlite3.sqlite_version) | ||||||
case "help": | ||||||
print("Enter SQL code and press enter.") | ||||||
case "quit": | ||||||
@@ -70,8 +70,9 @@ def runsource(self, source, filename="<input>", symbol="single"): | ||||||
pass | ||||||
case _ as unknown: | ||||||
t = theme.traceback | ||||||
print(f'{t.type}Error{t.reset}:{t.message} unknown command ' | ||||||
StanFromIreland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Note that the banner and tracebacks are written using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Errors (35) use print? And so do the other match statements branches. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Other branches output to stdout. Line 35 perhaps should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. We can leave There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
It is up to you/Erlend. The box to allow you to commit was checked. | ||||||
f'or invalid arguments: "{unknown}"{t.reset}', | ||||||
file=sys.stderr) | ||||||
serhiy-storchaka marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||||||
else: | ||||||
if not sqlite3.complete_statement(source): | ||||||
return True | ||||||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -130,7 +130,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: unknown command or invalid arguments", err) | ||
picnixz marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page.
serhiy-storchaka marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
# test "unknown_command" is pointed out in the error message | ||
self.assertIn("unknown_command", err) | ||
Uh oh!
There was an error while loading.Please reload this page.