diff --git a/cve_bin_tool/parsers/env.py b/cve_bin_tool/parsers/env.py index 5c776ca861..4e003c5401 100644 --- a/cve_bin_tool/parsers/env.py +++ b/cve_bin_tool/parsers/env.py @@ -93,7 +93,11 @@ def run_checker(self, filename): str: ScanInfo objects for the packages listed in the file. """ self.filename = filename - contents = pathlib.Path(self.filename).read_text() + try: + contents = pathlib.Path(self.filename).read_text() + except UnicodeDecodeError: + self.logger.debug(f"{filename} is an invalid .env file") + return env_config = self.parse_file_contents(contents)