Skip to content

Commit 029e408

Browse files
committed
Add NEWS entry for pyexpat re-entrant fix
1 parent c924f57 commit 029e408

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

Lib/test/test_pyexpat.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ def test_parse_again(self):
277277
expat.errors.XML_ERROR_FINISHED)
278278

279279
def test_reentrant_parse_crash(self):
280-
from xml.parsers import expat
281280
p = expat.ParserCreate(encoding="utf-16")
282281

283282
def start(name, attrs):
@@ -294,7 +293,6 @@ def handler(data):
294293
"cannot call Parse() from within a handler")
295294

296295
def test_parse_normal(self):
297-
from xml.parsers import expat
298296
p = expat.ParserCreate()
299297
data = "<root><child/></root>".encode('utf-8')
300298
try:

Misc/NEWS.d/next/Library/2026-03-19-10-30-20.gh-issue-146169.NXUmTH.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Prevent re-entrant calls to ``Parse()`` from within expat handlers,
2+
which could cause a crash. Now raises :exc:`RuntimeError` when such a
3+
call is attempted.

0 commit comments

Comments
 (0)