Skip to content

gh-153658: sqlite3.Connection.iterdump() fails for names with single quote#153666

Closed
joshiaradhya wants to merge 2 commits into
python:mainfrom
joshiaradhya:joshiaradhya-fix-sqlite3-iterdump-quote-bug
Closed

gh-153658: sqlite3.Connection.iterdump() fails for names with single quote#153666
joshiaradhya wants to merge 2 commits into
python:mainfrom
joshiaradhya:joshiaradhya-fix-sqlite3-iterdump-quote-bug

Conversation

@joshiaradhya

@joshiaradhya joshiaradhya commented Jul 13, 2026

Copy link
Copy Markdown

This fixes issue #153658 by escaping single quotes when emitting identifiers inside single-quoted SQL string literals in sqlite3.Connection.iterdump().\n\nChanges:\n- Lib/sqlite3/dump.py: double single quotes for the identifier when embedded into a string literal (keep double-quoted identifier for PRAGMA/FROM).\n- Lib/test/test_sqlite3/test_dump.py: added tests for table names containing single and double quotes.\n\nAll local DumpTests pass.\n\nFixes #153658

…entifiers embedded in string literals\n\nProperly double single quotes when embedding a double-quoted identifier into a single-quoted SQL string literal so table/column names with apostrophes round-trip.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Jul 13, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot

python-cla-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

…gment for bpo-153658 so the change is recorded in Misc/NEWS.d.
@erlend-aasland erlend-aasland changed the title bpo-153658: sqlite3.Connection.iterdump() fails for names with single quote gh-153658: sqlite3.Connection.iterdump() fails for names with single quote Jul 13, 2026
@bedevere-app

bedevere-app Bot commented Jul 13, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@joshiaradhya joshiaradhya deleted the joshiaradhya-fix-sqlite3-iterdump-quote-bug branch July 13, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant