Skip to content

Commit

Permalink
fix: handle CMFCore file
Browse files Browse the repository at this point in the history
The file
`src/Products/CMFCore/tests/fake_skins/fake_skin/test_text_latin1.txt`
in `Products.CMFCore` breaks while trying to read it with a Unicode
error.

Rather than breaking, at least report about it.
  • Loading branch information
gforcada committed Dec 28, 2023
1 parent 7ba63ef commit 0e1ebf6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions z3c/dependencychecker/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,12 @@ def create_from_files(cls, top_dir):
)

def scan(self):
try:
yield from self._scan()
except UnicodeDecodeError:
logger.error("Unicode Problems parsing %s", self.path)

def _scan(self):
with open(self.path) as doc_file:
for line in doc_file:
code = self._extract_code(line)
Expand Down

0 comments on commit 0e1ebf6

Please sign in to comment.