Skip to content

Commit

Permalink
Use text mode writing files
Browse files Browse the repository at this point in the history
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
  • Loading branch information
TheJackiMonster committed Dec 12, 2023
1 parent 41e59d7 commit f274cd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manuskript/exporter/manuskript/plainText.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def export(self, settingsWidget):
LOGGER.error("No content. Nothing saved.")
return

with open(filename, "w", encoding="utf8", newline="\n") as f:
with open(filename, "wt", encoding="utf8", newline="\n") as f:
f.write(content)

def preview(self, settingsWidget, previewWidget):
Expand Down
4 changes: 2 additions & 2 deletions manuskript/load_save/version_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def saveProject(zip=None):
filesWithPermissionErrors.append(filename)
else:
try:
with open(filename, "w", encoding="utf8", newline="\n") as f:
with open(filename, "wt", encoding="utf8", newline="\n") as f:
f.write(content)
except PermissionError as e:
LOGGER.error("Cannot open file " + filename + " for writing: " + e.strerror)
Expand Down Expand Up @@ -423,7 +423,7 @@ def saveProject(zip=None):

# Write the project file's content
try:
with open(project, "w", encoding="utf8", newline="\n") as f:
with open(project, "wt", encoding="utf8", newline="\n") as f:
f.write("1") # Format number
except PermissionError as e:
LOGGER.error("Cannot open file " + project + " for writing: " + e.strerror)
Expand Down

0 comments on commit f274cd4

Please sign in to comment.