Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
b3ee072b
Commit
b3ee072b
authored
Mar 28, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The client also needs to be able to unpickle zodbpickle.binary
Fixes #113
parent
6693ddf7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
14 deletions
+23
-14
CHANGES.rst
CHANGES.rst
+4
-0
src/ZEO/asyncio/marshal.py
src/ZEO/asyncio/marshal.py
+5
-2
src/ZEO/tests/ConnectionTests.py
src/ZEO/tests/ConnectionTests.py
+7
-6
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+5
-4
src/ZEO/tests/testZEO2.py
src/ZEO/tests/testZEO2.py
+2
-2
No files found.
CHANGES.rst
View file @
b3ee072b
...
@@ -16,6 +16,10 @@ Changelog
...
@@ -16,6 +16,10 @@ Changelog
with Python 3.7. See `issue 104
with Python 3.7. See `issue 104
<https://github.com/zopefoundation/ZEO/issues/104>`_.
<https://github.com/zopefoundation/ZEO/issues/104>`_.
- Fix: Client-side updates for ZODB 5.4.0 or databases that already
had ``zodbpickle.binary`` OIDs. See `issue 113
<https://github.com/zopefoundation/ZEO/issues/113>`_.
5.1.2 (2018-03-27)
5.1.2 (2018-03-27)
------------------
------------------
...
...
src/ZEO/asyncio/marshal.py
View file @
b3ee072b
...
@@ -24,6 +24,7 @@ import logging
...
@@ -24,6 +24,7 @@ import logging
from
.._compat
import
Unpickler
,
Pickler
,
BytesIO
,
PY3
,
PYPY
from
.._compat
import
Unpickler
,
Pickler
,
BytesIO
,
PY3
,
PYPY
from
..shortrepr
import
short_repr
from
..shortrepr
import
short_repr
PY2
=
not
PY3
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
def
encoder
(
protocol
,
server
=
False
):
def
encoder
(
protocol
,
server
=
False
):
...
@@ -132,6 +133,8 @@ _silly = ('__doc__',)
...
@@ -132,6 +133,8 @@ _silly = ('__doc__',)
exception_type_type
=
type
(
Exception
)
exception_type_type
=
type
(
Exception
)
_SAFE_MODULE_NAMES
=
(
'ZopeUndo.Prefix'
,
'copy_reg'
,
'__builtin__'
,
'zodbpickle'
)
def
find_global
(
module
,
name
):
def
find_global
(
module
,
name
):
"""Helper for message unpickler"""
"""Helper for message unpickler"""
try
:
try
:
...
@@ -144,7 +147,7 @@ def find_global(module, name):
...
@@ -144,7 +147,7 @@ def find_global(module, name):
except
AttributeError
:
except
AttributeError
:
raise
ImportError
(
"module %s has no global %s"
%
(
module
,
name
))
raise
ImportError
(
"module %s has no global %s"
%
(
module
,
name
))
safe
=
getattr
(
r
,
'__no_side_effects__'
,
0
)
safe
=
getattr
(
r
,
'__no_side_effects__'
,
0
)
or
(
PY2
and
module
in
_SAFE_MODULE_NAMES
)
if
safe
:
if
safe
:
return
r
return
r
...
@@ -156,7 +159,7 @@ def find_global(module, name):
...
@@ -156,7 +159,7 @@ def find_global(module, name):
def
server_find_global
(
module
,
name
):
def
server_find_global
(
module
,
name
):
"""Helper for message unpickler"""
"""Helper for message unpickler"""
if
module
not
in
(
'ZopeUndo.Prefix'
,
'copy_reg'
,
'__builtin__'
,
'zodbpickle'
)
:
if
module
not
in
_SAFE_MODULE_NAMES
:
raise
ImportError
(
"Module not allowed: %s"
%
(
module
,))
raise
ImportError
(
"Module not allowed: %s"
%
(
module
,))
try
:
try
:
...
...
src/ZEO/tests/ConnectionTests.py
View file @
b3ee072b
...
@@ -965,13 +965,14 @@ class TimeoutTests(CommonSetupTearDown):
...
@@ -965,13 +965,14 @@ class TimeoutTests(CommonSetupTearDown):
self
.
assertRaises
(
ClientDisconnected
,
storage
.
tpc_finish
,
txn
)
self
.
assertRaises
(
ClientDisconnected
,
storage
.
tpc_finish
,
txn
)
# Make sure it's logged as CRITICAL
# Make sure it's logged as CRITICAL
for
line
in
open
(
"server.log"
):
with
open
(
"server.log"
)
as
f
:
if
((
'Transaction timeout after'
in
line
)
and
for
line
in
f
:
(
'CRITICAL ZEO.StorageServer'
in
line
)
if
((
'Transaction timeout after'
in
line
)
and
(
'CRITICAL ZEO.StorageServer'
in
line
)
):
):
break
break
else
:
else
:
self
.
assertTrue
(
False
,
'bad logging'
)
self
.
fail
(
'bad logging'
)
storage
.
close
()
storage
.
close
()
...
...
src/ZEO/tests/testZEO.py
View file @
b3ee072b
...
@@ -1353,10 +1353,11 @@ You can specify the client label via a configuration file as well:
...
@@ -1353,10 +1353,11 @@ You can specify the client label via a configuration file as well:
>>> db.close()
>>> db.close()
>>> @wait_until
>>> @wait_until
... def check_for_test_label_2():
... def check_for_test_label_2():
... for line in open('server.log'):
... with open('server.log') as f:
... if 'test-label-2' in line:
... for line in f:
... print(line.split()[1:4])
... if 'test-label-2' in line:
... return True
... print(line.split()[1:4])
... return True
['INFO', 'ZEO.StorageServer', '(test-label-2']
['INFO', 'ZEO.StorageServer', '(test-label-2']
"""
"""
...
...
src/ZEO/tests/testZEO2.py
View file @
b3ee072b
...
@@ -500,8 +500,8 @@ def test_suite():
...
@@ -500,8 +500,8 @@ def test_suite():
doctest
.
DocTestSuite
(
doctest
.
DocTestSuite
(
setUp
=
ZODB
.
tests
.
util
.
setUp
,
tearDown
=
setupstack
.
tearDown
,
setUp
=
ZODB
.
tests
.
util
.
setUp
,
tearDown
=
setupstack
.
tearDown
,
checker
=
renormalizing
.
RENormalizing
([
checker
=
renormalizing
.
RENormalizing
([
(
re
.
compile
(
'
\
d+/
t
est-addr'
),
''
),
(
re
.
compile
(
r
'\
d+/
test-addr'
),
''
),
(
re
.
compile
(
"'lock_time':
\
d+.
\
d+"
),
'lock_time'
),
(
re
.
compile
(
r
"'lock_time': \
d+.
\d+"
),
'lock_time'
),
(
re
.
compile
(
r"'start': '[^\n]+'"
),
'start'
),
(
re
.
compile
(
r"'start': '[^\n]+'"
),
'start'
),
(
re
.
compile
(
'ZODB.POSException.StorageTransactionError'
),
(
re
.
compile
(
'ZODB.POSException.StorageTransactionError'
),
'StorageTransactionError'
),
'StorageTransactionError'
),
...
...
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