ValueError: timestamp out of range for platform time_t

Issue #5 resolved
Former user created an issue

We’ve run into this exception with the attached plist, but only on a 32-bit Python.

"ValueError: timestamp out of range for platform time_t”

Here’s one workaround (use timedelta).

https://github.com/obspy/obspy/issues/805#issuecomment-44095353

Comments (5)

  1. Andrew Wooster repo owner

    With the patch applied, I get the following error when running the unit tests:

    ======================================================================
    ERROR: testDatetime (test_write.TestWritePlist)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/andrew/Projects/bitbucket/biplist/tests/test_write.py", line 93, in testDatetime
        self.roundTrip([now])
      File "/Users/andrew/Projects/bitbucket/biplist/tests/test_write.py", line 19, in roundTrip
        plist = writePlistToString(root, binary=(not xml))
      File "/Users/andrew/Projects/bitbucket/biplist/biplist/__init__.py", line 174, in writePlistToString
        writer.writeRoot(rootObject)
      File "/Users/andrew/Projects/bitbucket/biplist/biplist/__init__.py", line 500, in writeRoot
        output = self.writeObject(wrapped_root, output, setReferencePosition=True)
      File "/Users/andrew/Projects/bitbucket/biplist/biplist/__init__.py", line 699, in writeObject
        output = self.writeObject(objRef, output, setReferencePosition=True)
      File "/Users/andrew/Projects/bitbucket/biplist/biplist/__init__.py", line 671, in writeObject
        timestamp -= apple_reference_date_offset
    TypeError: unsupported operand type(s) for -=: 'int' and 'datetime.datetime'
    
    ----------------------------------------------------------------------
    
  2. Log in to comment