Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xml_marshaller
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
nexedi
xml_marshaller
Commits
3e793e44
Commit
3e793e44
authored
Feb 22, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! xml_marshaller: stop distinguish unicode and bytes and always return 'str'
We always returned unicode.
parent
357d558c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/xml_marshaller/xml_marshaller.py
src/xml_marshaller/xml_marshaller.py
+8
-5
No files found.
src/xml_marshaller/xml_marshaller.py
View file @
3e793e44
...
@@ -29,6 +29,11 @@ try:
...
@@ -29,6 +29,11 @@ try:
cmp
cmp
except
NameError
:
except
NameError
:
cmp
=
lambda
x
,
y
:
(
x
>
y
)
-
(
x
<
y
)
cmp
=
lambda
x
,
y
:
(
x
>
y
)
-
(
x
<
y
)
def
unicode2str
(
s
):
return
s
else
:
def
unicode2str
(
s
):
return
s
.
encode
(
'utf-8'
)
@
cmp_to_key
@
cmp_to_key
def
version_independent_cmp
(
a
,
b
):
def
version_independent_cmp
(
a
,
b
):
...
@@ -441,7 +446,7 @@ class Unmarshaller(ElementTreeContentHandler):
...
@@ -441,7 +446,7 @@ class Unmarshaller(ElementTreeContentHandler):
def
um_end_string
(
self
,
name
):
def
um_end_string
(
self
,
name
):
ds
=
self
.
data_stack
ds
=
self
.
data_stack
ds
[
-
1
]
=
un
escape
(
''
.
join
(
ds
[
-
1
]
))
ds
[
-
1
]
=
un
icode2str
(
unescape
(
''
.
join
(
ds
[
-
1
])
))
self
.
accumulating_chars
=
0
self
.
accumulating_chars
=
0
def
um_end_int
(
self
,
name
):
def
um_end_int
(
self
,
name
):
...
@@ -583,10 +588,8 @@ class Unmarshaller(ElementTreeContentHandler):
...
@@ -583,10 +588,8 @@ class Unmarshaller(ElementTreeContentHandler):
klass
.
__name__
,
err
)),
sys
.
exc_info
()[
2
])
klass
.
__name__
,
err
)),
sys
.
exc_info
()[
2
])
# Now set the object's attributes from the marshalled dictionary
# Now set the object's attributes from the marshalled dictionary
for
k
,
v
in
kw
.
items
():
for
x
in
kw
.
items
():
if
not
isinstance
(
k
,
str
):
setattr
(
value
,
*
x
)
k
=
k
.
decode
()
setattr
(
value
,
k
,
v
)
self
.
data_stack
[
-
5
:]
=
[
value
]
self
.
data_stack
[
-
5
:]
=
[
value
]
# Helper class for instance unmarshalling
# Helper class for instance unmarshalling
...
...
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