Skip to content

Commit

Permalink
Merge a66c2f0 into 0f1e730
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jun 10, 2016
2 parents 0f1e730 + a66c2f0 commit 2680b5d
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 4 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
7 changes: 7 additions & 0 deletions relstorage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,13 @@ def loadBefore(self, oid, tid):
if end_int is not None:
end = p64(end_int)
else:
if state is None:
# This can happen if something attempts to load
# an object whose creation has been undone, see load()
# XXX: Is this the only place? What if just state is None?
# This change fixes the test in TransactionalUndoStorage.checkUndoCreationBranch1
self._log_keyerror(oid_int, "creation has been undone")
raise POSKeyError(oid)
end = None
if state is not None:
state = str(state)
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 2680b5d

Please sign in to comment.