Issue 27663: Inconsistent CSV Writer Behaviour (original) (raw)

Issue27663

Created on 2016-08-01 10:27 by gfyoung, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bug.py gfyoung,2016-08-01 10:27 Demonstration of the bug
Messages (4)
msg271779 - (view) Author: G Young (gfyoung) * Date: 2016-08-01 10:27
When writing scientific notation to CSV with custom line-terminators, the behaviour is inconsistent depending on the line-terminator you use. In the file provided, two different line-terminator result in one quoting the number as a string and the other not. IMO the second example is correct, but I don't understand why the behaviours should be any different.
msg271780 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-08-01 10:37
It is quoting the values when line terminator contains any of the special characters. Exactly like documented. https://docs.python.org/3/library/csv.html#csv.QUOTE_MINIMAL
msg271781 - (view) Author: G Young (gfyoung) * Date: 2016-08-01 10:39
That doesn't make sense to me. Can you explain how that is intended behaviour? I just changed from '-' to '?' in the lineterminator.
msg271782 - (view) Author: G Young (gfyoung) * Date: 2016-08-01 10:43
Second time around does the charm. I see the hidden "-" in the scientific notation is causing this. Thanks!
History
Date User Action Args
2022-04-11 14:58:34 admin set github: 71850
2016-08-01 10:43:04 gfyoung set messages: +
2016-08-01 10:39:39 gfyoung set messages: +
2016-08-01 10:37:52 SilentGhost set status: open -> closedtype: behaviornosy: + SilentGhostmessages: + resolution: not a bugstage: resolved
2016-08-01 10:27:37 gfyoung create