From ae9f47e741176bf2c45ef3fcc12c80a7d1f53256 Mon Sep 17 00:00:00 2001 From: Stan Date: Fri, 28 Apr 2023 09:24:21 +0000 Subject: [PATCH] encoding="utf-8" is not supported before Python 3.10. This was SVN commit r27622. --- source/tools/i18n/cleanTranslationFiles.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/tools/i18n/cleanTranslationFiles.py b/source/tools/i18n/cleanTranslationFiles.py index fec86e10a8..c552ef3607 100644 --- a/source/tools/i18n/cleanTranslationFiles.py +++ b/source/tools/i18n/cleanTranslationFiles.py @@ -35,7 +35,7 @@ def main(): translatorMatch = re.compile("(# [^,<]*)(?: <.*>)?(?:, [0-9,-]{4,9})") lastTranslatorMatch = re.compile("(\"Last-Translator: [^,<]*)(?: <.*>)?( ?\\\\n\")") - for root, folders, filenames in os.walk(projectRootDirectory): + for root, folders, _ in os.walk(projectRootDirectory): for folder in folders: if folder == l10nFolderName: if os.path.exists(os.path.join(root, folder, transifexClientFolder)): @@ -44,10 +44,10 @@ def main(): for file in files: usernames = [] reached = False - for line in fileinput.input(file.replace("\\", "/"), inplace=True, encoding="utf-8"): + for line in fileinput.input(file.replace("\\", "/"), inplace=True): if reached: if line == "# \n": - line = "" + line = "" m = translatorMatch.match(line) if m: if m.group(1) in usernames: