csv: keep on failing on nul bytes (#86355)
gitea/passerelle/pipeline/head This commit looks good
Details
gitea/passerelle/pipeline/head This commit looks good
Details
This commit is contained in:
parent
1c7f6c2557
commit
129e2a5af3
|
@ -251,6 +251,8 @@ class CsvDataSource(BaseResource):
|
|||
file_type = self.csv_file.name.split('.')[-1]
|
||||
if file_type not in ('ods', 'xls', 'xlsx'):
|
||||
content = self.get_content_without_bom()
|
||||
if '\x00' in content:
|
||||
raise ValueError(_('line contains NUL'))
|
||||
reader = csv.reader(content.splitlines(), **self.dialect_options)
|
||||
rows = list(reader)
|
||||
|
||||
|
|
Loading…
Reference in New Issue