[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:
parent
b8f93a7bc6
commit
aec461651e
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue