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
94369990
Commit
94369990
authored
Mar 07, 2024
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
May 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XMLExportImport: Base_asXML and Folder_asXML return str, not bytes.
parent
503943ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
product/ERP5Type/XMLExportImport/__init__.py
product/ERP5Type/XMLExportImport/__init__.py
+5
-5
No files found.
product/ERP5Type/XMLExportImport/__init__.py
View file @
94369990
...
...
@@ -55,7 +55,7 @@ else:
from
base64
import
standard_b64encode
,
encodebytes
from
hashlib
import
sha1
from
Products.ERP5Type.Utils
import
ensure_list
from
Products.ERP5Type.Utils
import
bytes2str
#from zLOG import LOG
try
:
...
...
@@ -209,8 +209,8 @@ def Base_asXML(object, root=None):
local_group_node
.
append
(
marshaller
(
group_role
[
1
]))
if
return_as_object
:
return
root
return
etree
.
tostring
(
root
,
encoding
=
'utf-8'
,
xml_declaration
=
True
,
pretty_print
=
True
)
return
bytes2str
(
etree
.
tostring
(
root
,
encoding
=
'utf-8'
,
xml_declaration
=
True
,
pretty_print
=
True
)
)
def
Folder_asXML
(
object
,
omit_xml_declaration
=
True
,
root
=
None
):
"""
...
...
@@ -231,8 +231,8 @@ def Folder_asXML(object, omit_xml_declaration=True, root=None):
if
issubclass
(
o
.
__class__
,
Base
):
o
.
asXML
(
root
=
root_node
)
return
etree
.
tostring
(
root
,
encoding
=
'utf-8'
,
xml_declaration
=
xml_declaration
,
pretty_print
=
True
)
return
bytes2str
(
etree
.
tostring
(
root
,
encoding
=
'utf-8'
,
xml_declaration
=
xml_declaration
,
pretty_print
=
True
)
)
## The code below was initially from OFS.XMLExportImport
from
six
import
string_types
as
basestring
...
...
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