mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-127165: Disallow embedded NULL characters in _interpreters
(#127199)
This commit is contained in:
parent
328187cc4f
commit
46bfd26fb2
2 changed files with 9 additions and 0 deletions
|
@ -1649,6 +1649,10 @@ class LowLevelTests(TestBase):
|
|||
self.assertIs(after2, None)
|
||||
self.assertEqual(after3.type.__name__, 'AssertionError')
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
# GH-127165: Embedded NULL characters broke the lookup
|
||||
_interpreters.set___main___attrs(interpid, {"\x00": 1})
|
||||
|
||||
with self.subTest('from C-API'):
|
||||
with self.interpreter_from_capi() as interpid:
|
||||
with self.assertRaisesRegex(InterpreterError, 'unrecognized'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue