From 46784659f9c9b25cfb243e7ca5094df738fdd880 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 3 Sep 2014 17:08:30 +0200 Subject: [PATCH] [IMP] ir.attachment: include traceback when logging low-level filesystem errors --- openerp/addons/base/ir/ir_attachment.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index de768d23cc6..c636463be10 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -123,7 +123,7 @@ class ir_attachment(osv.osv): else: r = open(full_path,'rb').read().encode('base64') except IOError: - _logger.error("_read_file reading %s",full_path) + _logger.exception("_read_file reading %s", full_path) return r def _file_write(self, cr, uid, value): @@ -134,7 +134,7 @@ class ir_attachment(osv.osv): with open(full_path, 'wb') as fp: fp.write(bin_value) except IOError: - _logger.error("_file_write writing %s", full_path) + _logger.exception("_file_write writing %s", full_path) return fname def _file_delete(self, cr, uid, fname): @@ -144,10 +144,10 @@ class ir_attachment(osv.osv): try: os.unlink(full_path) except OSError: - _logger.error("_file_delete could not unlink %s",full_path) + _logger.exception("_file_delete could not unlink %s", full_path) except IOError: # Harmless and needed for race conditions - _logger.error("_file_delete could not unlink %s",full_path) + _logger.exception("_file_delete could not unlink %s", full_path) def _data_get(self, cr, uid, ids, name, arg, context=None): if context is None: