[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ce5a3cd9b15c9379753aefabd696bff11495cbbb by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32255: Always quote a single empty field when write into a CSV file. (GH-4769) (#4810)

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Licht! -- ___ Python tracker ___

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2001900b0c02a397d8cf1d776a7cc7fcb2a463e3 by Serhiy Storchaka (Licht Takeuchi) in branch 'master': bpo-32255: Always quote a single empty field when write into a CSV file. (#4769)

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-12 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4705 stage: needs patch -> patch review ___ Python tracker ___

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-11 Thread Licht Takeuchi
Licht Takeuchi added the comment: PR is now fixed so as to follow the behavior on Python 2.7! -- ___ Python tracker ___

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-10 Thread Licht Takeuchi
Licht Takeuchi added the comment: Thanks for your investigation! Would you mind if I create a new patch? -- ___ Python tracker ___

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For restoring the 3.4 behavior the single empty field must be quoted. This allows to distinguish a 1-element row with the single empty field from an empty row. -- ___ Python tracker

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-10 Thread R. David Murray
R. David Murray added the comment: The second case is indeed the bug, as can be seen by running the examples against python2.7. It looks like this was probably broken by 7901b48a1f89 from issue 23171. -- components: +Library (Lib) -IO nosy: +r.david.murray

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-10 Thread R. David Murray
R. David Murray added the comment: Serhiy, since it was your patch that probably introduced this bug, can you take a look? Obviously it isn't a very high priority bug, since no one has reported a problem (even this issue isn't reporting the change in behavior as a

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-09 Thread Licht Takeuchi
Licht Takeuchi added the comment: The current implementation does not quote in most case. IOW, the patch which makes all '' is quoted is the breaking change (Note that there are some applications does not use quoting). -- ___

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-09 Thread Licht Takeuchi
Licht Takeuchi added the comment: I think the first one is buggy and there are two reasons. 1. The both are valid CSV. The double quoting is unnecessary. Some other applications, eg. Excel, does not use the double quoting. Also, the current implementation make to quote

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-09 Thread Nitish
Nitish added the comment: Which scenario you think is the wrong behaviour in this case? First one or second one? I don't know much about csv module, but I thought it was a deliberate choice made to quote all empty lines and hence considered the second scenario as

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-09 Thread Licht Takeuchi
Change by Licht Takeuchi : -- keywords: +patch pull_requests: +4672 stage: -> patch review ___ Python tracker ___

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-08 Thread Nitish
Change by Nitish : -- nosy: +nitishch ___ Python tracker ___ ___ Python-bugs-list

[issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'

2017-12-08 Thread Licht Takeuchi
New submission from Licht Takeuchi : Inconsistent behavior while reading a single column CSV. I have the patch and waiting for the CLA response. # Case 1 ## Input ``` import csv fp = open('test.csv', 'w') w = csv.writer(fp) w.writerow(['']) w.writerow(['1']) fp.close() ```