]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111803: Support loading more deeply nested lists in binary plist format (GH-114024)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 13 Jan 2024 13:26:55 +0000 (15:26 +0200)
committerGitHub <noreply@github.com>
Sat, 13 Jan 2024 13:26:55 +0000 (15:26 +0200)
It no longer uses the C stack. The depth of nesting is only limited by
Python recursion limit setting.

Lib/plistlib.py
Misc/NEWS.d/next/Library/2024-01-13-14-20-31.gh-issue-111803.llpLAw.rst [new file with mode: 0644]

index 188a0b399b587b26676b90adbd2fe9ceaf15eb8f..67e832db217319b44c2f8bd78d5648b283a1ee19 100644 (file)
@@ -600,7 +600,8 @@ class _BinaryPlistParser:
             obj_refs = self._read_refs(s)
             result = []
             self._objects[ref] = result
-            result.extend(self._read_object(x) for x in obj_refs)
+            for x in obj_refs:
+                result.append(self._read_object(x))
 
         # tokenH == 0xB0 is documented as 'ordset', but is not actually
         # implemented in the Apple reference code.
diff --git a/Misc/NEWS.d/next/Library/2024-01-13-14-20-31.gh-issue-111803.llpLAw.rst b/Misc/NEWS.d/next/Library/2024-01-13-14-20-31.gh-issue-111803.llpLAw.rst
new file mode 100644 (file)
index 0000000..546a892
--- /dev/null
@@ -0,0 +1,2 @@
+:mod:`plistlib` now supports loading more deeply nested lists in binary
+format.