Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1597678 - different translation to timedelta with Python 3.7
Summary: different translation to timedelta with Python 3.7
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-vobject
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pierre-YvesChibon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON37
TreeView+ depends on / blocked
 
Reported: 2018-07-03 12:20 UTC by Dan Horák
Modified: 2018-07-03 15:02 UTC (History)
5 users (show)

Fixed In Version: python-vobject-0.9.5-3.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-03 15:02:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.