From ee240c654d6c8b2903455075e8f217dfc99ae662 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Wed, 8 Jan 2025 05:14:13 -0800 Subject: [PATCH] Fixed PLW1514 (unspecified-encoding): `open` in text mode without explicit `encoding` argument --- tools/readable_bash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/readable_bash.py b/tools/readable_bash.py index 41eb153b..54703339 100644 --- a/tools/readable_bash.py +++ b/tools/readable_bash.py @@ -124,7 +124,7 @@ def generate_documentation(): """) parser = Source.parser() - with open("setup/start.sh") as start_file: + with open("setup/start.sh", encoding="utf-8") as start_file: for line in start_file: try: fn = parser.parse_string(line).filename() @@ -401,7 +401,7 @@ class BashScript(Grammar): @staticmethod def parse(fn): if fn in ("setup/functions.sh", "/etc/mailinabox.conf"): return "" - with open(fn) as f: + with open(fn, encoding="utf-8") as f: string = f.read() # tokenize