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
29d6c7b7
Commit
29d6c7b7
authored
2 years ago
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: add str2unicode() utility function, that does nothing in Python 3.
parent
33ee8497
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
product/ERP5Type/Utils.py
product/ERP5Type/Utils.py
+4
-0
product/ERP5Type/__init__.py
product/ERP5Type/__init__.py
+1
-1
No files found.
product/ERP5Type/Utils.py
View file @
29d6c7b7
...
@@ -567,6 +567,8 @@ def checkPythonSourceCode(source_code_str, portal_type=None):
...
@@ -567,6 +567,8 @@ def checkPythonSourceCode(source_code_str, portal_type=None):
if
str
is
bytes
:
if
str
is
bytes
:
bytes2str
=
str2bytes
=
lambda
s
:
s
bytes2str
=
str2bytes
=
lambda
s
:
s
def
str2unicode
(
s
):
return
s
.
decode
(
'utf-8'
)
def
unicode2str
(
s
):
def
unicode2str
(
s
):
return
s
.
encode
(
'utf-8'
)
return
s
.
encode
(
'utf-8'
)
else
:
else
:
...
@@ -574,6 +576,8 @@ else:
...
@@ -574,6 +576,8 @@ else:
return
s
.
decode
()
return
s
.
decode
()
def
str2bytes
(
s
):
def
str2bytes
(
s
):
return
s
.
encode
()
return
s
.
encode
()
def
str2unicode
(
s
):
return
s
def
unicode2str
(
s
):
def
unicode2str
(
s
):
return
s
return
s
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/__init__.py
View file @
29d6c7b7
...
@@ -189,7 +189,7 @@ ModuleSecurityInfo('Products.ERP5Type.Utils').declarePublic(
...
@@ -189,7 +189,7 @@ ModuleSecurityInfo('Products.ERP5Type.Utils').declarePublic(
'int2letter'
,
'getMessageIdWithContext'
,
'getTranslationStringWithContext'
,
'int2letter'
,
'getMessageIdWithContext'
,
'getTranslationStringWithContext'
,
'Email_parseAddressHeader'
,
'guessEncodingFromText'
,
'Email_parseAddressHeader'
,
'guessEncodingFromText'
,
'isValidTALESExpression'
,
'isValidTALESExpression'
,
'ensure_list'
,
'bytes2str'
,
'str2bytes'
,
'unicode2str'
,
'ensure_list'
,
'bytes2str'
,
'str2bytes'
,
'
str2unicode'
,
'
unicode2str'
,
)
)
allow_module
(
'Products.ERP5Type.Message'
)
allow_module
(
'Products.ERP5Type.Message'
)
...
...
This diff is collapsed.
Click to expand it.
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