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
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
erp5
Commits
1e1e062c
Commit
1e1e062c
authored
Apr 02, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! XMLExportImport: Base_asXML and Folder_asXML return str, not bytes.
parent
85410315
Changes
1
Show 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 @
1e1e062c
...
...
@@ -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
=
'unicode'
if
six
.
PY3
else
'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
=
'unicode'
if
six
.
PY3
else
'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