[New-bugs-announce] [issue30324] Error using newline='' when writing to CSV file

BeamPower report at bugs.python.org
Tue May 9 18:31:41 EDT 2017


New submission from BeamPower:

I am using the newline='' feature in my program to avoid the extra lines being placed between each line being written to a CSV file.
This error is odd though... I used it before on a previous rev, and it worked fine.
I think the CSV file writing feature has been available since Python 2.3?

Here's the error I am getting:

Traceback (most recent call last):
  File "C:\Python\parser\parser.py", line 91, in <module>
    write_header_to_csv()
  File "C:\Python\parser\parser.py", line 44, in write_header_to_csv
    csvfile = open('decodedfile.csv', 'w', newline='')
TypeError: 'newline' is an invalid keyword argument for this function

At the top of my program, I have the following imports:
import sys
import binascii
import csv

----------
messages: 293356
nosy: BeamPower
priority: normal
severity: normal
status: open
title: Error using newline='' when writing to CSV file

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30324>
_______________________________________


More information about the New-bugs-announce mailing list