persistent 4.0.9 hashes on 32-bit

Bug #1444197 reported by Jerry James
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ZODB
Undecided
Unassigned

Bug Description

The latest release of persistent, 4.0.9, fails some of its tests on 32-bit systems:

======================================================================
FAIL: test_hash_equal (persistent.tests.test_timestamp.PyAndCComparisonTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-persistent-4.0.9/persistent-4.0.9/persistent/tests/test_timestamp.py", line 254, in test_hash_equal
    self.assertEqual(hash(c), hash(py))
AssertionError: -1419374591 != 1979033151
======================================================================
FAIL: test_hash_equal_constants (persistent.tests.test_timestamp.PyAndCComparisonTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-persistent-4.0.9/persistent-4.0.9/persistent/tests/test_timestamp.py", line 272, in test_hash_equal_constants
    self.assertEqual(hash(c), 1000006000001)
AssertionError: -721379967 != 1000006000001L
----------------------------------------------------------------------

This is because timestamp hash codes are the same size as a C long, but the code assumes they are 64 bits in some places. The attached patch fixes the issue.

Revision history for this message
Jerry James (loganjerry) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers