Issue #12848: The pure Python pickle implementation now treats object lengths as unsigned 32-bit integers, like the C implementation does.
Patch by Serhiy Storchaka.
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index fc5f871..18eaa38 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -1579,7 +1579,7 @@
          * byte at the start, and cut it back later if possible.
          */
         nbytes = (nbits >> 3) + 1;
-        if (nbytes > INT_MAX) {
+        if (nbytes > 0x7fffffffL) {
             PyErr_SetString(PyExc_OverflowError,
                             "long too large to pickle");
             goto error;