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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
265e1b7b
Commit
265e1b7b
authored
Mar 06, 2024
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
May 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: use py2 compatible pickle protocol in testXMLPickle.
parent
be9d0d00
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 @
265e1b7b
...
@@ -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