Skip to content

Commit

Permalink
Merge fa0d4d9 into 7014e0d
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinW80 committed Jun 12, 2020
2 parents 7014e0d + fa0d4d9 commit ee93069
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doorstop/common.py
Expand Up @@ -160,19 +160,20 @@ def write_lines(lines, path, end='\n', encoding='utf-8'):
return path


def write_text(text, path):
def write_text(text, path, end='\n'):
"""Write text to a file.
:param text: string
:param path: file to write text
:param end: string to end lines
:param encoding: output file encoding
:return: path of new file
"""
if text:
log.trace("writing text to '{}'...".format(path)) # type: ignore
with open(path, 'w', encoding='utf-8') as f:
with open(path, 'w', encoding='utf-8', newline=end) as f:
f.write(text)
return path

Expand Down

0 comments on commit ee93069

Please sign in to comment.