mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-12 17:02:36 +12:00
Use text mode writing files
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
41e59d71c1
commit
f274cd489f
|
@ -96,7 +96,7 @@ class plainText(basicFormat):
|
||||||
LOGGER.error("No content. Nothing saved.")
|
LOGGER.error("No content. Nothing saved.")
|
||||||
return
|
return
|
||||||
|
|
||||||
with open(filename, "w", encoding="utf8", newline="\n") as f:
|
with open(filename, "wt", encoding="utf8", newline="\n") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
||||||
def preview(self, settingsWidget, previewWidget):
|
def preview(self, settingsWidget, previewWidget):
|
||||||
|
|
|
@ -388,7 +388,7 @@ def saveProject(zip=None):
|
||||||
filesWithPermissionErrors.append(filename)
|
filesWithPermissionErrors.append(filename)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
with open(filename, "w", encoding="utf8", newline="\n") as f:
|
with open(filename, "wt", encoding="utf8", newline="\n") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
LOGGER.error("Cannot open file " + filename + " for writing: " + e.strerror)
|
LOGGER.error("Cannot open file " + filename + " for writing: " + e.strerror)
|
||||||
|
@ -423,7 +423,7 @@ def saveProject(zip=None):
|
||||||
|
|
||||||
# Write the project file's content
|
# Write the project file's content
|
||||||
try:
|
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
|
f.write("1") # Format number
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
LOGGER.error("Cannot open file " + project + " for writing: " + e.strerror)
|
LOGGER.error("Cannot open file " + project + " for writing: " + e.strerror)
|
||||||
|
|
Loading…
Reference in a new issue