diff options
Diffstat (limited to 'addons/web/controllers/main.py')
| -rw-r--r-- | addons/web/controllers/main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index d893271ac6c..40f351e7f78 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1155,7 +1155,8 @@ class View(http.Controller): class Binary(http.Controller): def placeholder(self, image='placeholder.png'): - return tools.file_open(get_resource_path('web', 'static/src/img', image), 'rb').read() + with tools.file_open(get_resource_path('web', 'static/src/img', image), 'rb') as fd: + return fd.read() @http.route(['/web/content', '/web/content/<string:xmlid>', |
