Open CSV export file using with newline translation
The csv documentation [1] explains that file object used in writer should be opened with newline as empty string. [1] https://docs.python.org/3/library/csv.html Closes #12115
This commit is contained in:
@@ -435,7 +435,7 @@ class Form(TabContent):
|
||||
delimiter = ';'
|
||||
fileno, fname = tempfile.mkstemp(
|
||||
'.csv', common.slugify(export['name']) + '_')
|
||||
with open(fname, 'w') as fp:
|
||||
with open(fname, 'w', newline='') as fp:
|
||||
writer = csv.writer(fp, delimiter=delimiter)
|
||||
for row, path in zip_longest(data, paths or []):
|
||||
indent = len(path) - 1 if path else 0
|
||||
|
||||
Reference in New Issue
Block a user