Bug 1597678

Summary: different translation to timedelta with Python 3.7
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: python-vobjectAssignee: Pierre-YvesChibon <pingou>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dan, dgoodwin, jbowes, mhroncok, pingou
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-vobject-0.9.5-3.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-03 15:02:31 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: 1565020    

Description Dan Horák 2018-07-03 12:20:15 UTC
Description of problem:
python-vobject test-suite fails under Python 3.7 with

FAIL: test_MultiDateBehavior (tests.TestBehaviors)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/vobject-0.9.5/tests.py", line 257, in test_MultiDateBehavior
    "<RDATE{'VALUE': ['PERIOD']}[(datetime.datetime(1996, 4, 3, 2, 0, tzinfo=tzutc()), datetime.datetime(1996, 4, 3, 4, 0, tzinfo=tzutc())), (datetime.datetime(1996, 4, 4, 1, 0, tzinfo=tzutc()), datetime.timedelta(0, 10800))]>"
AssertionError: "<RDA[160 chars]4, 1, 0, tzinfo=tzutc()), datetime.timedelta(seconds=10800))]>" != "<RDA[160 chars]4, 1, 0, tzinfo=tzutc()), datetime.timedelta(0, 10800))]>"
- <RDATE{'VALUE': ['PERIOD']}[(datetime.datetime(1996, 4, 3, 2, 0, tzinfo=tzutc()), datetime.datetime(1996, 4, 3, 4, 0, tzinfo=tzutc())), (datetime.datetime(1996, 4, 4, 1, 0, tzinfo=tzutc()), datetime.timedelta(seconds=10800))]>
?                                                                                                                                                                                                                  ^^^^^^^^
+ <RDATE{'VALUE': ['PERIOD']}[(datetime.datetime(1996, 4, 3, 2, 0, tzinfo=tzutc()), datetime.datetime(1996, 4, 3, 4, 0, tzinfo=tzutc())), (datetime.datetime(1996, 4, 4, 1, 0, tzinfo=tzutc()), datetime.timedelta(0, 10800))]>
?                                                                                                                                                                                                                  ^^^

The test in question is https://github.com/eventable/vobject/blob/master/tests.py#L245
As you can see the problem is in the interpretation of the "PT3H" suffix, it changed from timedelta(0,10800) to timedelta(seconds=10800) which is equivalent.

Version-Release number of selected component (if applicable):
python-vobject-0.9.5-2.fc29

Comment 1 Miro Hrončok 2018-07-03 12:26:21 UTC
This is a documented repr change.

https://docs.python.org/3.7/whatsnew/3.7.html#changes-in-the-python-api

https://bugs.python.org/issue30302

Comment 2 Dan Horák 2018-07-03 14:47:47 UTC
I've proposed https://github.com/eventable/vobject/pull/122 as an upstream fix.