diff --git a/README.md b/README.md index dd3ab86..1bf2848 100644 --- a/README.md +++ b/README.md @@ -1261,8 +1261,10 @@ Open **Opens a file and returns a corresponding file object.** ```python - = open('', mode='r', encoding=None) + = open('', mode='r', encoding=None, endline=None) ``` +* **`'encoding=None'` means default encoding is used, which is platform dependent. Best practice is to use `"encoding='utf-8'"` whenever possible.** +* **`'endline=None'` means all different end of line combinations are converted to '\n' on read, while on write all '\n' characters are converted to system's default line separator.** ### Modes * **`'r'` - Read (default).** diff --git a/index.html b/index.html index 4e784d4..816b2ac 100644 --- a/index.html +++ b/index.html @@ -1141,8 +1141,12 @@ value = args.<name>

#Open

Opens a file and returns a corresponding file object.

-
<file> = open('<path>', mode='r', encoding=None)
+
<file> = open('<path>', mode='r', encoding=None, endline=None)
 
+
    +
  • 'encoding=None' means default encoding is used, which is platform dependent. Best practice is to use "encoding='utf-8'" whenever possible.
  • +
  • 'endline=None' means all different end of line combinations are converted to '\n' on read, while on write all '\n' characters are converted to system's default line separator.
  • +

Modes

  • 'r' - Read (default).