[3.12] gh-113785: csv: fields starting with escapechar are not quoted (GH-122110) (GH-122259)

(cherry picked from commit a3327dbfd4)

Co-authored-by: Mikołaj Kuranowski <mkuranowski@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-08-09 18:04:29 +02:00 committed by GitHub
parent c57a33d006
commit 9d7209fc93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 0 deletions

View file

@ -701,6 +701,8 @@ parse_process_char(ReaderObj *self, _csvstate *module_state, Py_UCS4 c)
}
else if (c == dialect->escapechar) {
/* possible escaped character */
if (dialect->quoting == QUOTE_NONNUMERIC)
self->numeric_field = 1;
self->state = ESCAPED_CHAR;
}
else if (c == ' ' && dialect->skipinitialspace)