From 55fe9d28c0b81690f605f05e4cce6cc8873d920e Mon Sep 17 00:00:00 2001 From: mpheath Date: Tue, 31 Aug 2021 08:31:09 +1000 Subject: Bug [#2279] Ensure file closed. Drop deprecated "U" as that is the default. --- scripts/Face.py | 2 +- scripts/FileGenerator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Face.py b/scripts/Face.py index 1559dfccd..21fc67995 100644 --- a/scripts/Face.py +++ b/scripts/Face.py @@ -144,4 +144,4 @@ class Face: name, value = featureVal.split("=", 1) self.aliases[name] = value currentComment = [] - + file.close() diff --git a/scripts/FileGenerator.py b/scripts/FileGenerator.py index aaa0a8ac9..e7b0f236d 100644 --- a/scripts/FileGenerator.py +++ b/scripts/FileGenerator.py @@ -175,7 +175,7 @@ def UpdateLineInFile(path, linePrefix, lineReplace): def ReadFileAsList(path): """Read all the lnes in the file and return as a list of strings without line ends. """ - with codecs.open(path, "rU", "utf-8") as f: + with codecs.open(path, "r", "utf-8") as f: return [l.rstrip('\n') for l in f] def UpdateFileFromLines(path, lines, lineEndToUse): -- cgit v1.2.3