diff --git a/inkscape-split-extensions-extra.py b/inkscape-split-extensions-extra.py index 1adbf4e..b9e578e 100644 --- a/inkscape-split-extensions-extra.py +++ b/inkscape-split-extensions-extra.py @@ -11,7 +11,7 @@ def make_deplist(inx_list, module_list): inx_regex = re.compile(rf">(.+)\.py") for entry in inx_list: - with open(os.path.join(".", entry)) as file: + with open(os.path.join(".", entry), encoding="utf-8") as file: for line in file: match = inx_regex.search(line) if (match and match.group(1) @@ -21,7 +21,7 @@ def make_deplist(inx_list, module_list): for module in module_list.union(modules): name = os.path.join(".", f"{module}.py") if os.path.isfile(name): - with open(name) as file: + with open(name, encoding="utf-8") as file: for line in file: match = re.match(r"from (.+) import", line) if not match: @@ -53,7 +53,7 @@ if __name__ == "__main__": # Search all .py files importing one of the mentioned modules. for entry in pathlib.Path(".").glob("**/*.py"): - with entry.open() as file: + with entry.open(encoding="utf-8") as file: for line in file: if import_regex.search(line): name = str(entry.as_posix()) @@ -79,7 +79,7 @@ if __name__ == "__main__": for entry in pathlib.Path(".").iterdir(): if entry.is_file() and entry.suffix == ".inx": - with entry.open() as file: + with entry.open(encoding="utf-8") as file: for line in file: if inx_regex.search(line): extra_inx.add(entry.name) @@ -103,17 +103,17 @@ if __name__ == "__main__": std_list = work_dir / "inkscape.lst" extra_list = work_dir / "inkscape-extensions-extra.lst" - with std_list.open("w") as file: + with std_list.open("w", encoding="utf-8") as file: for inx in std_inx: if not exclusion_regex.match(inx): print(f"{prefix}{inx}", file=file) - with extra_list.open("w") as file: + with extra_list.open("w", encoding="utf-8") as file: for inx in extra_inx: if not exclusion_regex.match(inx): print(f"{prefix}{inx}", file=file) - with std_list.open("a") as std_file, extra_list.open("a") as extra_file: + with std_list.open("a", encoding="utf-8") as std_file, extra_list.open("a", encoding="utf-8") as extra_file: for entry in pathlib.Path(".").iterdir(): if entry.is_file() and entry.suffix == ".py": name = str(entry.as_posix()) diff --git a/inkscape.changes b/inkscape.changes index 3304008..d08dc54 100644 --- a/inkscape.changes +++ b/inkscape.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 7 08:30:50 UTC 2020 - thod_@gmx.de + +- Fix inkscape-split-extensions-extra.py for older python versions. + ------------------------------------------------------------------- Tue May 4 15:29:43 UTC 2020 - Alexei Sorokin