Skip to content

Commit

Permalink
Merge 22cd087 into 0f1e730
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jun 10, 2016
2 parents 0f1e730 + 22cd087 commit 5515ba8
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1.7.0a1 (Unreleased)
--------------------

- Update the ZODB dependency from ZODB3 3.7.0 to ZODB 4.3.0.

- Fixed ``loadBefore`` of a deleted/undone object to correctly raise a
POSKeyError instead of returning an empty state. (Revealed by
updated tests for FileStorage in ZODB 4.3.1.)

1.6.0b3 (2014-12-08)
--------------------
Expand Down
10 changes: 8 additions & 2 deletions relstorage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,15 +560,21 @@ def loadBefore(self, oid, tid):

state, start_tid = self._adapter.mover.load_before(
cursor, oid_int, u64(tid))

if start_tid is not None:
if state is None:
# This can happen if something attempts to load
# an object whose creation has been undone, see load()
# This change fixes the test in TransactionalUndoStorage.checkUndoCreationBranch1
# self._log_keyerror doesn't work here, only in certain states.
raise POSKeyError(oid)
end_int = self._adapter.mover.get_object_tid_after(
cursor, oid_int, start_tid)
if end_int is not None:
end = p64(end_int)
else:
end = None
if state is not None:
state = str(state)
state = str(state)
return state, p64(start_tid), end
else:
return None
Expand Down
2 changes: 2 additions & 0 deletions relstorage/tests/alltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
from .testpostgresql import test_suite as postgresql_test_suite
from .testmysql import test_suite as mysql_test_suite
from .testoracle import test_suite as oracle_test_suite
from .test_zodbconvert import test_suite as zodbconvert_test_suite

def make_suite():
suite = unittest.TestSuite()
suite.addTest(zodbconvert_test_suite())
suite.addTest(postgresql_test_suite())
suite.addTest(mysql_test_suite())
suite.addTest(oracle_test_suite())
Expand Down
2 changes: 1 addition & 1 deletion relstorage/tests/blob/testblob.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from ZODB.blob import Blob
from ZODB.DB import DB
from zope.testing import doctest
import doctest

import atexit
import collections
Expand Down
15 changes: 13 additions & 2 deletions relstorage/tests/reltestbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,20 @@ def inject_changes():
def checkPackBrokenPickle(self):
# Verify the pack stops with the right exception if it encounters
# a broken pickle.
from cPickle import UnpicklingError
# Under Python 2, with zodbpickle, there may be a difference depending
# on whether the accelerated implementation is in use.
from zodbpickle.pickle import UnpicklingError as pUnpickErr
unpick_errs = (pUnpickErr,)
try:
from zodbpickle.fastpickle import UnpicklingError as fUnpickErr
except ImportError:
pass
else:
unpick_errs += (fUnpickErr,)


self._dostoreNP(self._storage.new_oid(), data='brokenpickle')
self.assertRaises(UnpicklingError, self._storage.pack,
self.assertRaises(unpick_errs, self._storage.pack,
time.time() + 10000, referencesf)

def checkBackwardTimeTravelWithoutRevertWhenStale(self):
Expand Down
3 changes: 3 additions & 0 deletions relstorage/tests/test_zodbconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,6 @@ def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(ZODBConvertTests))
return suite

if __name__ == '__main__':
unittest.main()
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def read_file(*path):
zip_safe=False, # otherwise ZConfig can't see component.xml
install_requires=[
'perfmetrics',
'ZODB3>=3.7.0',
'ZODB >= 4.3.0, <5.0',
# ZEO is needed for blob layout
'ZEO >= 4.2.0b1, <5.0',
'zope.interface',
'zc.lockfile',
],
Expand Down

0 comments on commit 5515ba8

Please sign in to comment.