Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
nexedi
erp5
Commits
80b90e7c
Commit
80b90e7c
authored
2 years ago
by
Kazuhiko Shiozaki
Committed by
Arnaud Fontaine
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
py2/py3: unicode() does not exist in Python 3.
parent
4e156dc2
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+6
-2
product/PortalTransforms/transforms/safe_html.py
product/PortalTransforms/transforms/safe_html.py
+1
-1
No files found.
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
80b90e7c
...
...
@@ -1389,10 +1389,14 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
with
self
.
assertRaises
(
TypeError
):
person
.
setSocialTitle
(
social_title_value
)
# Passing a unicode object to a not-Value setter should raise
with
self
.
assertRaises
(
TypeError
):
organisation
=
self
.
portal
.
organisation_module
.
newContent
()
person
.
setSubordination
(
unicode
(
organisation
.
getRelativeUrl
()))
if
six
.
PY2
:
# Passing a unicode object to a not-Value setter should raise
person
.
setSubordination
(
six
.
text_type
(
organisation
.
getRelativeUrl
()))
else
:
# Passing a bytes object to a not-Value setter should raise
person
.
setSubordination
(
organisation
.
getRelativeUrl
().
encode
())
from
Products.ERP5Type.Tool.ComponentTool
import
ComponentTool
...
...
This diff is collapsed.
Click to expand it.
product/PortalTransforms/transforms/safe_html.py
View file @
80b90e7c
...
...
@@ -535,7 +535,7 @@ class SafeHTML:
# avoid breaking now.
# continue into the loop with repaired html
else
:
if
isinstance
(
orig
,
unicod
e
):
if
isinstance
(
orig
,
six
.
text_typ
e
):
orig
=
orig
.
encode
(
'utf-8'
)
data
.
setData
(
orig
)
break
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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