Bug 13835 - [4.10 backport needed]subunit/run.py: make iso8601 UTC usage python 2/3 compatible
Summary: [4.10 backport needed]subunit/run.py: make iso8601 UTC usage python 2/3 compa...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Test infrastructure (show other bugs)
Version: 4.10.0rc4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jelmer Vernooij
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-12 21:47 UTC by Joe Guo (mail address dead)
Modified: 2020-12-11 18:13 UTC (History)
1 user (show)

See Also:


Attachments
subunit/run.py: make iso8601 UTC usage python 2/3 compatible (1.84 KB, patch)
2019-03-12 21:47 UTC, Joe Guo (mail address dead)
no flags Details
the patch with cherry-picked-from (1.92 KB, patch)
2019-07-25 02:36 UTC, Douglas Bagnall
dbagnall: review? (abartlet)
dbagnall: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Guo (mail address dead) 2019-03-12 21:47:56 UTC
Created attachment 14924 [details]
subunit/run.py: make iso8601 UTC usage python 2/3 compatible

In `subunit/run.py`:
 
    from iso8601.iso8601 import Utc
    
In `iso8601/iso8601.py`:

    if sys.version_info >= (3, 2, 0):
        UTC = datetime.timezone.utc
        ...
    else:
        class Utc(datetime.tzinfo):
            ...

        UTC = Utc()

The class `Utc` is only available for python < 3.2.0, which implies `subunit/run.py` will not work with python 3.2.0+.
Use `UTC` instance instead, which is python 2/3 compatible.

The attached patch has already been applied to master as 02c7b8c03d4970421a5170e44c57cbc3cda82827, backport needed.
Comment 1 Douglas Bagnall 2019-07-25 02:36:33 UTC
Created attachment 15324 [details]
the patch with cherry-picked-from

`make testenv` in 4.10 fails without this.
Comment 2 Andrew Bartlett 2020-12-11 18:12:39 UTC
Sadly this didn't make it into Samba 4.10 before it closed for new changes.
Comment 3 Andrew Bartlett 2020-12-11 18:13:36 UTC
Fixed in master as 02c7b8c03d4970421a5170e44c57cbc3cda82827 and already fixed in Samba 4.11.