diff --git a/zenmap/zenmapCore/ScriptMetadata.py b/zenmap/zenmapCore/ScriptMetadata.py index e30722584..c3316fe34 100644 --- a/zenmap/zenmapCore/ScriptMetadata.py +++ b/zenmap/zenmapCore/ScriptMetadata.py @@ -296,7 +296,7 @@ class ScriptMetadata (object): self.get_string_variable(filename, "author")] filepath = os.path.join(self.scripts_dir, filename) - with open(filepath, "r", encoding="utf-8") as f: + with open(filepath, "r", encoding="utf-8", errors="replace") as f: for tag_name, tag_text in nsedoc_tags_iter(f): if tag_name == "output" and not entry.output: entry.output = tag_text @@ -309,7 +309,7 @@ class ScriptMetadata (object): @staticmethod def get_file_contents(filename): - with open(filename, "r", encoding="utf-8") as f: + with open(filename, "r", encoding="utf-8", errors="replace") as f: contents = f.read() return contents @@ -343,7 +343,7 @@ class ScriptMetadata (object): @staticmethod def get_requires(filename): - with open(filename, "r", encoding="utf-8") as f: + with open(filename, "r", encoding="utf-8", errors="replace") as f: requires = ScriptMetadata.get_requires_from_file(f) return requires @@ -359,7 +359,7 @@ class ScriptMetadata (object): @staticmethod def get_script_args(filename): - with open(filename, "r", encoding="utf-8") as f: + with open(filename, "r", encoding="utf-8", errors="replace") as f: args = ScriptMetadata.get_script_args_from_file(f) return args