Skip to content

Close CSV streams when row iteration fails - #951

Open
IlyaKhalafi wants to merge 1 commit into
simonw:mainfrom
IlyaKhalafi:daily/2026-11-15/sqlite-utils
Open

IlyaKhalafi wants to merge 1 commit into
simonw:mainfrom
IlyaKhalafi:daily/2026-11-15/sqlite-utils

Conversation

@IlyaKhalafi

@IlyaKhalafi IlyaKhalafi commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #950. Release the CSV reader stream when row iteration raises, as it already does on normal exhaustion. Errors still propagate, and TSV and detected CSV readers use the same cleanup path.

Both real-file regressions fail before the fix. CPython 3.14 tests pass with 1499 passed and 16 skips in both standard and sqlite-autocommit modes. Black, flake8, mypy, pyright and cog checks pass. Ty reports the same redundant-cast warning in unchanged db.py on the base and patched source.


📚 Documentation preview 📚: https://sqlite-utils--951.org.readthedocs.build/en/951/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSV input streams remain open after parsing errors

1 participant