[issue40473] Universal newline not recognizing Mac newline (CR) when using CSV on Windows 10

2020-05-01 Thread Larry Kuhn


Change by Larry Kuhn :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40473] Universal newline not recognizing Mac newline (CR) when using CSV on Windows 10

2020-05-01 Thread Larry Kuhn


New submission from Larry Kuhn :

Running open with or without rU generates this message when reading a CSV file 
with CR line endings:
DeprecationWarning: 'U' mode is deprecated
  with open(csvfile, mode='rU', newline='') as cf:
Traceback (most recent call last):
  File "d:/Larry/Desktop/Python/profiler project/csvprofiler/csvpcg.py", line 
245, in 
main()
  File "d:/Larry/Desktop/Python/profiler project/csvprofiler/csvpcg.py", line 
235, in main
csv_input()
  File "d:/Larry/Desktop/Python/profiler project/csvprofiler/csvpcg.py", line 
57, in csv_input
config_dict['has_header'] = csv.Sniffer().has_header(cf.read(10240))
  File "C:\Program Files\Python38\lib\csv.py", line 395, in has_header
header = next(rdr) # assume first row is header
_csv.Error: new-line character seen in unquoted field - do you need to open the 
file in universal-newline mode?

--
components: Windows
messages: 367889
nosy: larrykuhn, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Universal newline not recognizing Mac newline (CR) when using CSV on 
Windows 10
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com