Bug 1687959

Summary: pytz FTBFS with Python 3.8.0a2: PicklingTest.testDatabaseFixes fails / nonresponsive maintainer
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: pytzAssignee: Jef Spaleta <jspaleta>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gwync, jspaleta, orion
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-26 13:51:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1686977, 1731538    
Attachments:
Description Flags
build.log from copr none

Description Miro Hrončok 2019-03-12 18:31:24 UTC
Created attachment 1543326 [details]
build.log from copr

With both pytz-2018.5-2 and pytz-2018.9-1 I get the following test failure with Python 3.8.0a2 in copr:

=================================== FAILURES ===================================
________________________ PicklingTest.testDatabaseFixes ________________________

self = <test_tzinfo.PicklingTest testMethod=testDatabaseFixes>

    def testDatabaseFixes(self):
        # Hack the pickle to make it refer to a timezone abbreviation
        # that does not match anything. The unpickler should be able
        # to repair this case
        tz = pytz.timezone('Australia/Melbourne')
        p = pickle.dumps(tz)
        tzname = tz._tzname
        hacked_p = p.replace(
            _byte_string(tzname),
            _byte_string('?' * len(tzname))
        )
        self.assertNotEqual(p, hacked_p)
        unpickled_tz = pickle.loads(hacked_p)
        self.assertTrue(tz is unpickled_tz)
    
        # Simulate a database correction. In this case, the incorrect
        # data will continue to be used.
        p = pickle.dumps(tz)
        new_utcoffset = tz._utcoffset.seconds + 42
    
        # Python 3 introduced a new pickle protocol where numbers are stored in
        # hexadecimal representation. Here we extract the pickle
        # representation of the number for the current Python version.
        old_pickle_pattern = pickle.dumps(tz._utcoffset.seconds)[3:-1]
        new_pickle_pattern = pickle.dumps(new_utcoffset)[3:-1]
        hacked_p = p.replace(old_pickle_pattern, new_pickle_pattern)
    
>       self.assertNotEqual(p, hacked_p)
E       AssertionError: b'\x80\x04\x955\x00\x00\x00\x00\x00\x00\x00\x8c\x04pytz\x94\x8c\x02_p\x94\x93\x94(\x8c\x13Australia/Melbourne\x94M\xf0\x87K\x00\x8c\x03LMT\x94t\x94R\x94.' == b'\x80\x04\x955\x00\x00\x00\x00\x00\x00\x00\x8c\x04pytz\x94\x8c\x02_p\x94\x93\x94(\x8c\x13Australia/Melbourne\x94M\xf0\x87K\x00\x8c\x03LMT\x94t\x94R\x94.'

pytz/tests/test_tzinfo.py:191: AssertionError
=============== 1 failed, 232 passed, 1 skipped in 1.61 seconds ================


https://copr.fedorainfracloud.org/coprs/g/python/python3.8/build/867452/

Comment 1 Miro Hrončok 2019-03-12 18:34:10 UTC
Reported to upstream at https://bugs.launchpad.net/pytz/+bug/1819751

Comment 2 Miro Hrončok 2019-03-14 16:50:04 UTC
Victor proposed a patch upstream. It fixes the issue.

Comment 3 Miro Hrončok 2019-07-09 14:49:51 UTC
Jef, consider this a nonresponsive maintainer bug now.

Please respond.

Comment 4 Red Hat Bugzilla 2023-09-14 05:25:18 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days