Skip to content

Commit

Permalink
Fixed embedded ASS subtitles writing encoding error
Browse files Browse the repository at this point in the history
For a couple of files, I had UnicodeEncodeErrors raised when writing out a file it had successfully read in.
In my case, the output file was truncated to 1 KB.
  • Loading branch information
JaiZed authored May 2, 2024
1 parent ad151ff commit bea2f0b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def _clean_ass_subtitles(path, output_path):

logger.debug("Cleaned lines: %d", abs(len(lines) - len(clean_lines)))

with open(output_path, "w") as f:
with open(output_path, "w", encoding="utf-8", errors="ignore") as f:
f.writelines(clean_lines)
logger.debug("Lines written to output path: %s", output_path)

Expand Down

0 comments on commit bea2f0b

Please sign in to comment.