[3.13] gh-98820: Fix quadratic time in csv.Sniffer for quoted fields (GH-154867) - #155118
Conversation
…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>
|
Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
|
Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to |
|
Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to |
|
Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to |
|
Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to |
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