Skip to content

Commit 57801f4

Browse files
committed
gh-158500: Cover multibyte trailing date data
1 parent 897999d commit 57801f4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Lib/test/datetimetester.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,9 @@ def test_fromisoformat_fails(self):
21192119
'٢025-03-09', # Unicode characters
21202120
'2009\ud80002\ud80028', # Separators are surrogate codepoints
21212121
]
2122+
if not issubclass(self.theclass, datetime):
2123+
# 9 characters, 10 UTF-8 bytes; exercise the C parser's 10-byte path.
2124+
bad_strs.append('20200101\u00e9')
21222125

21232126
for bad_str in bad_strs:
21242127
with self.assertRaises(ValueError):

0 commit comments

Comments
 (0)