Skip to content

Commit

Permalink
fix: when loading ignores files that are not text files.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBCa committed Oct 19, 2024
1 parent f7ddaaa commit 6d8bde4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manuskript/load_save/version_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,10 @@ def loadProject(project, zip=None):
filename = os.path.join(dirpath, f)
with open(filename, 'rt', encoding="utf8") as fo:
files[os.path.join(p, f)] = fo.read()

except (UnicodeDecodeError, FileNotFoundError, IsADirectoryError) as e:
LOGGER.error("Ignore file: "+ filename + "because of the error " + e.reason)

except PermissionError as e:
LOGGER.error("Cannot open file " + filename + ": " + e.strerror)
errors.append(fo)
Expand Down

0 comments on commit 6d8bde4

Please sign in to comment.