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
b7ba4560
Commit
b7ba4560
authored
Sep 05, 2017
by
Mauro Amico
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ZopeUndo.Prefix decode on python 2
parent
d8438a30
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
setup.py
setup.py
+1
-0
src/ZEO/asyncio/marshal.py
src/ZEO/asyncio/marshal.py
+1
-1
src/ZEO/tests/test_marshal.py
src/ZEO/tests/test_marshal.py
+25
-0
No files found.
setup.py
View file @
b7ba4560
...
...
@@ -33,6 +33,7 @@ tests_require = [
'random2'
,
'mock'
,
'msgpack-python'
,
'ZopeUndo'
,
]
classifiers
=
"""
...
...
src/ZEO/asyncio/marshal.py
View file @
b7ba4560
...
...
@@ -157,7 +157,7 @@ def find_global(module, name):
def
server_find_global
(
module
,
name
):
"""Helper for message unpickler"""
try
:
if
module
!=
'ZopeUndo.Prefix'
:
if
module
not
in
(
'ZopeUndo.Prefix'
,
'copy_reg'
,
'__builtin__'
)
:
raise
ImportError
m
=
__import__
(
module
,
_globals
,
_globals
,
_silly
)
except
ImportError
as
msg
:
...
...
src/ZEO/tests/test_marshal.py
0 → 100644
View file @
b7ba4560
import
unittest
from
ZEO.asyncio.marshal
import
encode
from
ZEO.asyncio.marshal
import
pickle_server_decode
from
ZopeUndo.Prefix
import
Prefix
class
MarshalTests
(
unittest
.
TestCase
):
def
testServerDecodeZopeUndoFilter
(
self
):
# this is an example of Zope's
args
=
(
0
,
20
,
{
'user_name'
:
Prefix
(
'test'
)})
# test against repr because Prefix __eq__ operator
# doesn't compare Prefix with Prefix but only
# Prefix with strings. see Prefix.__doc__
self
.
assertEqual
(
repr
(
pickle_server_decode
(
encode
(
*
args
))),
repr
(
args
)
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
MarshalTests
))
return
suite
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