[New-bugs-announce] [issue32255] csv.writer converts None to '""\n' when it is first line, otherwise '\n'
Licht Takeuchi
report at bugs.python.org
Fri Dec 8 09:43:54 EST 2017
New submission from Licht Takeuchi <licht-t at outlook.jp>:
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()
```
## Output
```
""
1
```
# Case 2
## Input
```
import csv
fp = open('test.csv', 'w')
w = csv.writer(fp)
w.writerow(['1'])
w.writerow([''])
fp.close()
```
## Output
```
1
```
----------
components: IO
messages: 307851
nosy: licht-t
priority: normal
severity: normal
status: open
title: csv.writer converts None to '""\n' when it is first line, otherwise '\n'
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32255>
_______________________________________
More information about the New-bugs-announce
mailing list