We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8290df commit 7bbce38Copy full SHA for 7bbce38
Lib/test/test_embed.py
@@ -404,6 +404,12 @@ def test_ucnhash_capi_reset(self):
404
out, err = self.run_embedded_interpreter("test_repeated_init_exec", code)
405
self.assertEqual(out, '9\n' * INIT_LOOPS)
406
407
+ def test_datetime_type_dict(self):
408
+ # Test use-after-free of unicode keys in tp_dict
409
+ code = "import datetime; print(datetime.date.min)"
410
+ out, err = self.run_embedded_interpreter("test_repeated_init_exec", code)
411
+ self.assertEqual(out, '0001-01-01\n'* INIT_LOOPS)
412
+
413
414
@unittest.skipIf(_testinternalcapi is None, "requires _testinternalcapi")
415
class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
0 commit comments