### 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. ```console $ 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 <!-- gh-linked-prs --> ### Linked PRs * gh-153732 <!-- /gh-linked-prs -->