You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
copy.replace() loses slot-backed attributes of csv.Dialect subclasses. This can silently change how CSV data is parsed, even when the delimiter was not replaced.
Reproduced with CPython 3.16.0a1. The same implementation is present on main at 31a7d99.
Expected: both readers produce [['alpha', 'beta']], since only the quoting setting was replaced.
Dialect.__replace__() copies only __dict__, losing attributes stored in slots. The replacement therefore lacks its delimiter, and csv.reader falls back to the default comma delimiter.
Activity
pythongh-160106: Fix csv.Dialect.__replace__() losing slot-backed att…