Skip to content

[3.13] gh-98820: Fix quadratic time in csv.Sniffer for quoted fields (GH-154867) - #155118

Merged
Yhg1s merged 1 commit into
python:3.13from
miss-islington:backport-476fb09-3.13
Aug 4, 2026
Merged

[3.13] gh-98820: Fix quadratic time in csv.Sniffer for quoted fields (GH-154867)#155118
Yhg1s merged 1 commit into
python:3.13from
miss-islington:backport-476fb09-3.13

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The regular expressions which look for a quoted field matched its body
lazily, so a closing quote which was not followed by a delimiter was
retried with every following quote, to the end of the sample. Match
the body possessively instead: it ends at the first quote which is not
doubled, as it does for a reader.
(cherry picked from commit 476fb09)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com

…ields (pythonGH-154867)

The regular expressions which look for a quoted field matched its body
lazily, so a closing quote which was not followed by a delimiter was
retried with every following quote, to the end of the sample.  Match
the body possessively instead: it ends at the first quote which is not
doubled, as it does for a reader.
(cherry picked from commit 476fb09cdb0d73e645849d98c610e7e5697ce7c9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Yhg1s
Yhg1s merged commit b30c7fa into python:3.13 Aug 4, 2026
44 of 47 checks passed
@miss-islington
miss-islington deleted the backport-476fb09-3.13 branch August 4, 2026 09:03
@serhiy-storchaka serhiy-storchaka added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 4, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b30c7fa9edd921a118f286e9f90f560777fa693b 3.10

@miss-islington-app

Copy link
Copy Markdown

Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b30c7fa9edd921a118f286e9f90f560777fa693b 3.12

@miss-islington-app

Copy link
Copy Markdown

Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b30c7fa9edd921a118f286e9f90f560777fa693b 3.11

@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes and removed needs backport to 3.12 only security fixes labels Aug 4, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b30c7fa9edd921a118f286e9f90f560777fa693b 3.12

@serhiy-storchaka serhiy-storchaka removed needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-security A security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants