Commit 3bfaa547 authored by Christian Theune's avatar Christian Theune

Fix for bug #184054: MappingStorage used to raise a KeyError during `load`

instead of a POSKeyError.
parent 10e35640
......@@ -37,6 +37,9 @@ New Features
Bugs Fixed
----------
- Fix for bug #184054: MappingStorage used to raise a KeyError during `load`
instead of a POSKeyError.
- Fixed bug in Connection.TmpStore: load() would not defer to the backend
storage for loading blobs.
......
......@@ -58,8 +58,11 @@ class MappingStorage(BaseStorage):
def load(self, oid, version):
self._lock_acquire()
try:
p = self._index[oid]
return p[8:], p[:8] # pickle, serial
try:
p = self._index[oid]
return p[8:], p[:8] # pickle, serial
except KeyError:
raise POSException.POSKeyError(oid)
finally:
self._lock_release()
......
......@@ -209,12 +209,12 @@ class UserMethodTests(unittest.TestCase):
>>> obj._p_state
0
A request for an object that doesn't exist will raise a KeyError.
A request for an object that doesn't exist will raise a POSKeyError.
>>> cn.get(p64(1))
Traceback (most recent call last):
...
KeyError: '\x00\x00\x00\x00\x00\x00\x00\x01'
POSKeyError: 0x01
"""
def test_close(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment