This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Universal newline not recognizing Mac newline (CR) when using CSV on Windows 10
Type: behavior Stage: resolved
Components: Windows Versions:
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: larrykuhn, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2020-05-01 21:41 by larrykuhn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (1)
msg367889 - (view) Author: Larry Kuhn (larrykuhn) Date: 2020-05-01 21:41
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/", line 245, in <module>
  File "d:/Larry/Desktop/Python/profiler project/csvprofiler/", line 235, in main
  File "d:/Larry/Desktop/Python/profiler project/csvprofiler/", line 57, in csv_input
    config_dict['has_header'] = csv.Sniffer().has_header(
  File "C:\Program Files\Python38\lib\", 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?
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84653
2020-05-01 21:45:23larrykuhnsetstatus: open -> closed
resolution: not a bug
stage: resolved
2020-05-01 21:41:03larrykuhncreate