Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
persistent
Commits
13aaa3dc
Commit
13aaa3dc
authored
Apr 08, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix picklecache for persistent classes and
https://bugs.launchpad.net/zodb/+bug/185066
parent
b6fc8748
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
persistent/picklecache.py
persistent/picklecache.py
+8
-3
persistent/tests/test_picklecache.py
persistent/tests/test_picklecache.py
+1
-0
No files found.
persistent/picklecache.py
View file @
13aaa3dc
...
@@ -119,7 +119,7 @@ class PickleCache(object):
...
@@ -119,7 +119,7 @@ class PickleCache(object):
and
existing_cache
.
data
.
get
(
oid
)
is
not
None
):
and
existing_cache
.
data
.
get
(
oid
)
is
not
None
):
raise
ValueError
(
"Object already in another cache"
)
raise
ValueError
(
"Object already in another cache"
)
if
type
(
value
)
is
type
:
if
isinstance
(
value
,
type
):
# ZODB.persistentclass.PersistentMetaClass
self
.
persistent_classes
[
oid
]
=
value
self
.
persistent_classes
[
oid
]
=
value
else
:
else
:
self
.
data
[
oid
]
=
value
self
.
data
[
oid
]
=
value
...
@@ -236,9 +236,14 @@ class PickleCache(object):
...
@@ -236,9 +236,14 @@ class PickleCache(object):
raise
KeyError
(
'Duplicate OID: %s'
%
oid
)
raise
KeyError
(
'Duplicate OID: %s'
%
oid
)
obj
.
_p_oid
=
oid
obj
.
_p_oid
=
oid
obj
.
_p_jar
=
self
.
jar
obj
.
_p_jar
=
self
.
jar
if
type
(
obj
)
is
not
type
:
if
not
isinstance
(
obj
,
type
)
:
if
obj
.
_p_state
!=
GHOST
:
if
obj
.
_p_state
!=
GHOST
:
obj
.
_p_invalidate
()
# The C implementation sets this stuff directly,
# but we delegate to the class. However, we must be
# careful to avoid broken _p_invalidate and _p_deactivate
# that don't call the super class. See ZODB's
# testConnection.doctest_proper_ghost_initialization_with_empty__p_deactivate
obj
.
_p_invalidate_deactivate_helper
()
self
[
oid
]
=
obj
self
[
oid
]
=
obj
def
reify
(
self
,
to_reify
):
def
reify
(
self
,
to_reify
):
...
...
persistent/tests/test_picklecache.py
View file @
13aaa3dc
...
@@ -866,6 +866,7 @@ class DummyPersistent(object):
...
@@ -866,6 +866,7 @@ class DummyPersistent(object):
self
.
_p_state
=
GHOST
self
.
_p_state
=
GHOST
_p_deactivate
=
_p_invalidate
_p_deactivate
=
_p_invalidate
_p_invalidate_deactivate_helper
=
_p_invalidate
def
_p_activate
(
self
):
def
_p_activate
(
self
):
from
persistent.interfaces
import
UPTODATE
from
persistent.interfaces
import
UPTODATE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment