@@ -283,7 +283,7 @@ def sniff(
283283 try :
284284 # Attempt to parse first few lines with this delimiter
285285 # This is a simplified sniffer. A real one is much more complex.
286- potential_dialect_params = {"delimiter" : delim_char }
286+ potential_dialect_params : Dict [ str , Any ] = {"delimiter" : delim_char }
287287
288288 # Try to guess quotechar and quoting style
289289 # Count quotechar occurrences to infer
@@ -312,16 +312,10 @@ def sniff(
312312 ):
313313 potential_dialect_params ["doublequote" ] = True
314314 else :
315- potential_dialect_params ["doublequote" ] = (
316- False # Could be escapechar or just not used
317- )
315+ potential_dialect_params ["doublequote" ] = False
318316 else : # No clear quotechar or odd number, assume no quoting or minimal that's not obvious
319- potential_dialect_params ["quotechar" ] = (
320- '"' # Default, or could be None
321- )
322- potential_dialect_params ["quoting" ] = (
323- QUOTE_MINIMAL # Or QUOTE_NONE if no quotes seen
324- )
317+ potential_dialect_params ["quotechar" ] = '"'
318+ potential_dialect_params ["quoting" ] = QUOTE_MINIMAL
325319
326320 # This is where a mini-parser run would be beneficial
327321 # For now, use a heuristic: consistent number of fields
@@ -559,7 +553,8 @@ def reader(
559553 elif char == quotechar :
560554 if doublequote :
561555 if idx + 1 < len_row and row_str [idx + 1 ] == quotechar :
562- current_field += quotechar
556+ if quotechar is not None :
557+ current_field += quotechar
563558 idx += 1
564559 else :
565560 state = AFTER_QUOTED_FIELD
0 commit comments