mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Fix IndexError when parsing unexpectedly ending quoted-string. (GH-14813)
This exception was caused because the input ended unexpectedly with only one single quote instead of a pair with some value inside it.
This commit is contained in:
parent
a4a994bd3e
commit
719a062bcb
3 changed files with 7 additions and 1 deletions
|
@ -522,6 +522,10 @@ class TestParser(TestParserMixin, TestEmailBase):
|
|||
self._test_get_x(parser.get_bare_quoted_string,
|
||||
'""', '""', '', [], '')
|
||||
|
||||
def test_get_bare_quoted_string_missing_endquotes(self):
|
||||
self._test_get_x(parser.get_bare_quoted_string,
|
||||
'"', '""', '', [errors.InvalidHeaderDefect], '')
|
||||
|
||||
def test_get_bare_quoted_string_following_wsp_preserved(self):
|
||||
self._test_get_x(parser.get_bare_quoted_string,
|
||||
'"foo"\t bar', '"foo"', 'foo', [], '\t bar')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue