File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,9 @@ def __init__(
90
90
self .index_label = self ._initialize_index_label (index_label )
91
91
self .errors = errors
92
92
self .quoting = quoting or csvlib .QUOTE_MINIMAL
93
- self .quotechar = self ._initialize_quotechar (quotechar )
94
93
self .doublequote = doublequote
95
94
self .escapechar = escapechar
95
+ self .quotechar = self ._initialize_quotechar (quotechar )
96
96
self .lineterminator = lineterminator or os .linesep
97
97
self .date_format = date_format
98
98
self .cols = self ._initialize_columns (cols )
@@ -141,7 +141,7 @@ def _get_index_label_flat(self) -> Sequence[Hashable]:
141
141
return ["" ] if index_label is None else [index_label ]
142
142
143
143
def _initialize_quotechar (self , quotechar : str | None ) -> str | None :
144
- if self .quoting != csvlib .QUOTE_NONE :
144
+ if self .quoting != csvlib .QUOTE_NONE or self . escapechar is not None :
145
145
# prevents crash in _csv
146
146
return quotechar
147
147
return None
You can’t perform that action at this time.
0 commit comments