Skip to content

Commit

Permalink
Do not translate newlines in --print-to-file
Browse files Browse the repository at this point in the history
  • Loading branch information
pukkandan committed Apr 16, 2023
1 parent 84ffeb7 commit 9874e82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yt_dlp/YoutubeDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -2890,8 +2890,8 @@ def format_tmpl(tmpl):
tmpl = format_tmpl(tmpl)
self.to_screen(f'[info] Writing {tmpl!r} to: {filename}')
if self._ensure_dir_exists(filename):
with open(filename, 'a', encoding='utf-8') as f:
f.write(self.evaluate_outtmpl(tmpl, info_copy) + '\n')
with open(filename, 'a', encoding='utf-8', newline='') as f:
f.write(self.evaluate_outtmpl(tmpl, info_copy) + os.linesep)

def __forced_printings(self, info_dict, filename, incomplete):
def print_mandatory(field, actual_field=None):
Expand Down

1 comment on commit 9874e82

@chrizilla
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a bunch!

Please sign in to comment.