Bug description
The python -m sqlite3 interactive shell crashes with a traceback and exits
when an input line contains an embedded NUL byte, or a lone surrogate under a
surrogateescape stdin. sqlite3.complete_statement() raises ValueError
(embedded NUL) or UnicodeEncodeError (lone surrogate); neither is a
sqlite3.Error, so it escapes the REPL instead of being reported like an
ordinary error.
$ printf "SELECT '\0';\nSELECT 1;\n" | python -m sqlite3
sqlite> Traceback (most recent call last):
...
ValueError: embedded null character
The following SELECT 1; never runs. Invalid SQL and unknown dot-commands, by
contrast, print a clean error and keep the shell running.
CPython versions tested on
3.14, 3.15, 3.16
Operating systems tested on
macOS
Linked PRs
Bug description
The
python -m sqlite3interactive shell crashes with a traceback and exitswhen an input line contains an embedded NUL byte, or a lone surrogate under a
surrogateescapestdin.sqlite3.complete_statement()raisesValueError(embedded NUL) or
UnicodeEncodeError(lone surrogate); neither is asqlite3.Error, so it escapes the REPL instead of being reported like anordinary error.
The following
SELECT 1;never runs. Invalid SQL and unknown dot-commands, bycontrast, print a clean error and keep the shell running.
CPython versions tested on
3.14, 3.15, 3.16
Operating systems tested on
macOS
Linked PRs