[Python-checkins] bpo-42249: Fix writing binary Plist files larger than 4 GiB. (GH-23121)

serhiy-storchaka webhook-mailer at python.org
Tue Nov 3 09:16:02 EST 2020


https://github.com/python/cpython/commit/212d32f45c91849c17a82750df1ac498d63976be
commit: 212d32f45c91849c17a82750df1ac498d63976be
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2020-11-03T16:15:56+02:00
summary:

bpo-42249: Fix writing binary Plist files larger than 4 GiB. (GH-23121)

files:
A Misc/NEWS.d/next/Library/2020-11-03-09-22-56.bpo-42249.vfNO2u.rst
M Lib/plistlib.py

diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index 83b214e9dc49b..2eeebe4c9a424 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -611,7 +611,7 @@ def _count_to_size(count):
     elif count < 1 << 16:
         return 2
 
-    elif count << 1 << 32:
+    elif count < 1 << 32:
         return 4
 
     else:
diff --git a/Misc/NEWS.d/next/Library/2020-11-03-09-22-56.bpo-42249.vfNO2u.rst b/Misc/NEWS.d/next/Library/2020-11-03-09-22-56.bpo-42249.vfNO2u.rst
new file mode 100644
index 0000000000000..071a0fdda1ff8
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-11-03-09-22-56.bpo-42249.vfNO2u.rst
@@ -0,0 +1 @@
+Fixed writing binary Plist files larger than 4 GiB.



More information about the Python-checkins mailing list