diff --git a/README.md b/README.md index 6be8667..6648436 100644 --- a/README.md +++ b/README.md @@ -1661,6 +1661,7 @@ import csv .writerow() # Encodes objects using `str()`. .writerows() ``` +* **File must be open with `'newline=""'` argument, or newlines embedded inside quoted fields will not be interpreted correctly!** ### Parameters * **`'dialect'` - Master parameter that sets the default values.** @@ -1693,7 +1694,6 @@ def read_csv_file(filename): with open(filename, encoding='utf-8', newline='') as file: return csv.reader(file) ``` -* **If `'newline=""'` is not specified, then newlines embedded inside quoted fields will not be interpreted correctly.** ### Write Rows to CSV File ```python diff --git a/index.html b/index.html index 7ac7281..f56e851 100644 --- a/index.html +++ b/index.html @@ -1481,6 +1481,9 @@ os.replace(from, to) # Encodes objects using `str(<el>)`. <writer>.writerows(<coll_of_coll>) +
    +
  • File must be open with 'newline=""' argument, or newlines embedded inside quoted fields will not be interpreted correctly!
  • +

Parameters

  • 'dialect' - Master parameter that sets the default values.
  • @@ -1510,9 +1513,6 @@ os.replace(from, to) with open(filename, encoding='utf-8', newline='') as file: return csv.reader(file) -
      -
    • If 'newline=""' is not specified, then newlines embedded inside quoted fields will not be interpreted correctly.
    • -

    Write Rows to CSV File

    def write_to_csv_file(filename, rows):
         with open(filename, 'w', encoding='utf-8', newline='') as file: