mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Workaround Python 3.10.0 CSV escape issue. Fixes #1437
This commit is contained in:
@@ -231,9 +231,14 @@ def write_csv_file(csvRows, titles, list_type, todrive):
|
|||||||
'No columns selected with GAM_CSV_HEADER_FILTER and GAM_CSV_HEADER_DROP_FILTER\n'
|
'No columns selected with GAM_CSV_HEADER_FILTER and GAM_CSV_HEADER_DROP_FILTER\n'
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
csv.register_dialect('nixstdout',
|
nixstdout_dialect = {'lineterminator': '\n',
|
||||||
lineterminator='\n',
|
'quoting': csv.QUOTE_MINIMAL}
|
||||||
quoting=csv.QUOTE_MINIMAL)
|
# fix issue with Python 3.10.0 and no escape char
|
||||||
|
# 3.10.1+ may fix this within Python so hopefully
|
||||||
|
# this is short-lived.
|
||||||
|
if sys.version_info.minor >= 10:
|
||||||
|
nixstdout_dialect['escapechar'] = '\\'
|
||||||
|
csv.register_dialect('nixstdout', **nixstdout_dialect)
|
||||||
if todrive:
|
if todrive:
|
||||||
write_to = io.StringIO()
|
write_to = io.StringIO()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user