You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: domdf_python_tools/paths.py
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -488,6 +488,7 @@ def write_text(
488
488
data: str,
489
489
encoding: Optional[str] ="UTF-8",
490
490
errors: Optional[str] =None,
491
+
newline: Optional[str] =NEWLINE_DEFAULT,
491
492
) ->int:
492
493
"""
493
494
Open the file in text mode, write to it, and close the file.
@@ -497,9 +498,20 @@ def write_text(
497
498
:param data:
498
499
:param encoding: The encoding to write to the file in.
499
500
:param errors:
501
+
:param newline:
502
+
:default newline: `universal newlines <https://docs.python.org/3/glossary.html#term-universal-newlines>`__ for reading, Unix line endings (``LF``) for writing.
503
+
504
+
.. versionchanged:: 3.1.0
505
+
506
+
Added the ``newline`` argument to match Python 3.10.
0 commit comments