Skip to content

Commit

Permalink
Merge ff994be into 0ce6c49
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinW80 committed Jul 9, 2020
2 parents 0ce6c49 + ff994be commit fab312f
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 fab312f

Please sign in to comment.