I have a file loaded in memory from a Django form. It is giving me the following error:
new-line character seen in unquoted field - do you need to open the file in universal-newline mode?
Another solution used this.
However, i already have the file in memory so i require to change it to opening in "rU"
format.
This is my relevant code in views.py
form = ResultsUploadForm(request.POST, request.FILES)
if form.is_valid():
form.save()
reader = csv.reader(request.FILES['file'])
for row in reader:
#etc...
Does anyone know how to go about fixing this? The error is thrown from this statement for row in reader: