Bug 13835 - [4.10 backport needed]subunit/run.py: make iso8601 UTC usage python 2/3 compatible
[4.10 backport needed]subunit/run.py: make iso8601 UTC usage python 2/3 compa...
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Test infrastructure
4.10.0rc4
All All
: P5 normal
: ---
Assigned To: Jelmer Vernooij
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-12 21:47 UTC by Joe Guo
Modified: 2019-07-25 02:36 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
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 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.