[FIX] NUL byte in a file leads csv.reader to raise csv.Error

bzr revid: xmo@openerp.com-20120814123112-p4iio7fl561ronln
This commit is contained in:
Xavier Morel 2012-08-14 14:31:12 +02:00
parent b8f93a7bc6
commit aec461651e
1 changed files with 1 additions and 1 deletions

View File

@ -225,7 +225,7 @@ class ir_import(orm.TransientModel):
'headers': headers or False,
'preview': list(preview),
}
except (TypeError, UnicodeDecodeError), e:
except (csv.Error, TypeError, UnicodeDecodeError), e:
# Due to lazy generators, UnicodeDecodeError (for
# instance) may only be raised when serializing the
# preview to a list in the return.