+++ This bug was initially created as a clone of Bug #1724349 +++ Description of problem: ====== rh-python36 has the following issue when unpickling date-objects stored in python 2: Pickle a date in python 2: import datetime; pickle.dumps(datetime.date(2019, 12, 31), 2) '\x80\x02cdatetime\ndate\nq\x00U\x04\x07\xe3\x0c\x1fq\x01\x85q\x02Rq\x03.' Unpickle in python3 fails: x = b'\x80\x02cdatetime\ndate\nq\x00U\x04\x07\xe3\x0c\x1fq\x01\x85q\x02Rq\x03.'; pickle.loads(x, encoding='latin1') (...) TypeError: an integer is required (got type str) Version-Release number of selected component (if applicable): ====== rh-python36 (Python 3.6.3) How reproducible: ====== We're able to reproduce this ourselves Steps to Reproduce: ====== 1. $ python Python 2.7.5 (default, Mar 26 2019, 22:13:06) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime; import pickle; pickle.dumps(datetime.date(2019, 12, 31), 2) '\x80\x02cdatetime\ndate\nq\x00U\x04\x07\xe3\x0c\x1fq\x01\x85q\x02Rq\x03.' >>> 2. $ scl enable rh-python36 bash 3. $ python Python 3.6.3 (default, Apr 10 2019, 14:37:36) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime; import pickle; x = b'\x80\x02cdatetime\ndate\nq\x00U\x04\x07\xe3\x0c\x1fq\x01\x85q\x02Rq\x03.'; pickle.loads(x, encoding='latin1') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: an integer is required (got type str) >>> Actual results: ====== b'\x80\x02cdatetime\ndate\nq\x00U\x04\x07\xe3\x0c\x1fq\x01\x85q\x02Rq\x03.'; pickle.loads(x, encoding='latin1') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: an integer is required (got type str) Expected results: ====== '\x80\x02cdatetime\ndate\nq\x00U\x04\x07\xe3\x0c\x1fq\x01\x85q\x02Rq\x03.' Additional info: ====== This has been fixed upstream: https://github.com/python/cpython/commit/19f6e83bf03b3ce22300638906bd90dd2dd5c463 --- Additional comment from RHEL Product and Program Management on 2019-06-26 22:27:06 CEST --- Since this bug report was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release. --- Additional comment from Petr Viktorin on 2019-07-30 15:58:24 CEST --- This should be fixed with a rebase to 3.6.9.
Verified by `test_compat_unpickle` in https://tcms.engineering.redhat.com/case/604054/?from_plan=26960#case_run
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:3725