relativedelta fails if supplied with numpy.int64 as argument

Bug #1086737 reported by Will Furnass
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dateutil
New
Undecided
Unassigned

Bug Description

Would it be possible for relativedelta to be tweaked to allow it to accept numpy.int64 values as arguments?

At present this is what I get when using numpy 1.6 and dateutil 1.5:

datetime(2012,4,3) - dateutil.relativedelta.relativedelta(seconds = seconds[0])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-80-043ad91e8ee3> in <module>()
      1 seconds = pl.array([3,4,5])
----> 2 datetime(2012,4,3) - dateutil.relativedelta.relativedelta(seconds = seconds[0])

/usr/local/lib/python2.7/dist-packages/dateutil/relativedelta.pyc in __rsub__(self, other)
    287
    288 def __rsub__(self, other):
--> 289 return self.__neg__().__radd__(other)
    290
    291 def __add__(self, other):

/usr/local/lib/python2.7/dist-packages/dateutil/relativedelta.pyc in __radd__(self, other)
    274 minutes=self.minutes,
    275 seconds=self.seconds,
--> 276 microseconds=self.microseconds))
    277 if self.weekday:
    278 weekday, nth = self.weekday.weekday, self.weekday.n or 1

TypeError: unsupported type for timedelta seconds component: numpy.int64

Regards,

Will Furnass

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.