Skip to content

Commit b7c74e7

Browse files
committed
fix: add some more duct tape around decoding
1 parent cdeadf5 commit b7c74e7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/gitingest/schemas/filesystem_schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ def content(self) -> str: # pylint: disable=too-many-return-statements
137137
return f.read()
138138
except UnicodeDecodeError:
139139
continue
140+
except UnicodeError:
141+
continue
140142
except OSError as exc:
141143
return f"Error reading file: {exc}"
142144

src/gitingest/utils/file_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def is_text_file(path: Path) -> bool:
6666
return True
6767
except UnicodeDecodeError:
6868
continue
69+
except UnicodeError:
70+
continue
6971
except OSError:
7072
return False
7173

0 commit comments

Comments
 (0)