Skip to content

Commit

Permalink
Merge pull request #1332 from AlexBCa/bugfix/load-projects-with-unall…
Browse files Browse the repository at this point in the history
…owed-extensions

fix: when loading ignores files that are not text files.
  • Loading branch information
TheJackiMonster authored Oct 20, 2024
2 parents f7ddaaa + 6d8bde4 commit db361f3
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 db361f3

Please sign in to comment.