Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
99bf734f
Commit
99bf734f
authored
Mar 06, 2024
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: use py2 compatible pickle protocol in testXMLPickle.
parent
3ad0d119
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testXMLPickle.py
...TemplateItem/portal_components/test.erp5.testXMLPickle.py
+3
-2
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testXMLPickle.py
View file @
99bf734f
...
@@ -31,6 +31,7 @@ import pickle
...
@@ -31,6 +31,7 @@ import pickle
import
re
import
re
import
xml.sax
import
xml.sax
from
six.moves
import
cStringIO
as
StringIO
from
six.moves
import
cStringIO
as
StringIO
from
io
import
BytesIO
from
Products.ERP5Type.XMLExportImport
import
ppml
from
Products.ERP5Type.XMLExportImport
import
ppml
...
@@ -58,8 +59,8 @@ class TestXMLPickle(unittest.TestCase):
...
@@ -58,8 +59,8 @@ class TestXMLPickle(unittest.TestCase):
pattern
=
re
.
compile
(
'WAA'
)
# regex pattern object uses reduce.(See sre.py)
pattern
=
re
.
compile
(
'WAA'
)
# regex pattern object uses reduce.(See sre.py)
obj
.
data
.
append
(
pattern
)
obj
.
data
.
append
(
pattern
)
pickled_string
=
pickle
.
dumps
(
obj
)
pickled_string
=
pickle
.
dumps
(
obj
,
protocol
=
2
)
f
=
String
IO
(
pickled_string
)
f
=
Bytes
IO
(
pickled_string
)
xmldata
=
str
(
ppml
.
ToXMLUnpickler
(
f
).
load
())
xmldata
=
str
(
ppml
.
ToXMLUnpickler
(
f
).
load
())
output
=
StringIO
()
output
=
StringIO
()
...
...
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