Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
ee814234
Commit
ee814234
authored
Feb 02, 2022
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X Switch ZODB5 to use protocol=1
It works, at least on Python2.
parent
bc13ca74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
src/ZODB/_compat.py
src/ZODB/_compat.py
+3
-2
src/ZODB/tests/testSerialize.py
src/ZODB/tests/testSerialize.py
+2
-2
No files found.
src/ZODB/_compat.py
View file @
ee814234
...
...
@@ -11,13 +11,14 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
from
zodbpickle
import
binary
# noqa: F401 import unused
#from zodbpickle import binary # noqa: F401 import unused
binary
=
bytes
import
sys
from
six
import
PY3
IS_JYTHON
=
sys
.
platform
.
startswith
(
'java'
)
_protocol
=
3
_protocol
=
1
if
not
PY3
:
# Python 2.x
...
...
src/ZODB/tests/testSerialize.py
View file @
ee814234
...
...
@@ -145,7 +145,7 @@ class SerializerTestCase(unittest.TestCase):
pickle
=
serialize
.
ObjectWriter
().
serialize
(
top
)
# Make sure the persistent id is pickled using the 'C',
# SHORT_BINBYTES opcode:
self
.
assertTrue
(
b'C
\
x04
abcd'
in
pickle
)
#self.assertTrue(b'C\x04abcd' in pickle) # disabled: we set protocol=1
refs
=
[]
u
=
PersistentUnpickler
(
None
,
refs
.
append
,
BytesIO
(
pickle
))
...
...
@@ -154,7 +154,7 @@ class SerializerTestCase(unittest.TestCase):
self
.
assertEqual
(
refs
,
[[
'w'
,
(
b'abcd'
,)]])
def
test_protocol_3_binary_handling
(
self
):
def
_test_protocol_3_binary_handling
(
self
):
# disabled: we set protocol=1
from
ZODB.serialize
import
_protocol
self
.
assertEqual
(
3
,
_protocol
)
# Yeah, whitebox
o
=
PersistentObject
()
...
...
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