Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
1475a1c2
Commit
1475a1c2
authored
7 years ago
by
Christophe Simonis
Browse files
Options
Downloads
Patches
Plain Diff
[FIX][P3] core: correctly handle binary files (base64 encoded) at rpc level
parent
3a6e7f98
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
odoo/service/server.py
+3
-0
3 additions, 0 deletions
odoo/service/server.py
odoo/service/wsgi_server.py
+11
-0
11 additions, 0 deletions
odoo/service/wsgi_server.py
with
14 additions
and
0 deletions
odoo/service/server.py
+
3
−
0
View file @
1475a1c2
...
...
@@ -961,7 +961,10 @@ def start(preload=None, stop=False):
"""
Start the odoo http server and cron processor.
"""
global
server
load_server_wide_modules
()
odoo
.
service
.
wsgi_server
.
_patch_xmlrpc_marshaller
()
if
odoo
.
evented
:
server
=
GeventServer
(
odoo
.
service
.
wsgi_server
.
application
)
elif
config
[
'
workers
'
]:
...
...
This diff is collapsed.
Click to expand it.
odoo/service/wsgi_server.py
+
11
−
0
View file @
1475a1c2
...
...
@@ -88,6 +88,17 @@ def xmlrpc_handle_exception_string(e):
return
xmlrpclib
.
dumps
(
fault
,
allow_none
=
None
,
encoding
=
None
)
def
_patch_xmlrpc_marshaller
():
# By default, in xmlrpc, bytes are converted to xmlrpclib.Binary object.
# Historically, odoo is sending binary as base64 string.
# In python 3, base64.b64{de,en}code() methods now works on bytes.
# Convert them to str to have a consistent behavior between python 2 and python 3.
# TODO? Create a `/xmlrpc/3` route prefix that respect the standard and uses xmlrpclib.Binary.
def
dump_bytes
(
marshaller
,
value
,
write
):
marshaller
.
dump_unicode
(
odoo
.
tools
.
ustr
(
value
),
write
)
xmlrpclib
.
Marshaller
.
dispatch
[
bytes
]
=
dump_bytes
def
wsgi_xmlrpc
(
environ
,
start_response
):
"""
Two routes are available for XML-RPC
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment