From 96b7a07cb67e7264ad6e7b4ef3d3e7fdf70c70b5 Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 27 Aug 2021 19:35:15 +0200 Subject: doc/tools: Silence encoding lint --- doc/tools/convert_papermode_to_metadata.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/tools/convert_papermode_to_metadata.py b/doc/tools/convert_papermode_to_metadata.py index 57459097..58371193 100755 --- a/doc/tools/convert_papermode_to_metadata.py +++ b/doc/tools/convert_papermode_to_metadata.py @@ -36,9 +36,10 @@ def replace(source, target): print("Skipping file `%s'" % source) return - result = dict() + result = {} # Read the input file and convert it to a dictionary + # pylint: disable=unspecified-encoding with open(".paperinfo", "r") as infile: reader = csv.reader(infile, skipinitialspace=True) for lineno, row in enumerate(reader): @@ -59,6 +60,9 @@ def replace(source, target): # Write the obtained dictionary into the target file if result: + # There's no way to specify encoding in 2.x even though in this case we + # could choose to write in UTF-8. + # pylint: disable=unspecified-encoding with open(".metadata.json", "w") as outfile: json.dump(result, outfile, indent=2) else: -- cgit 1.4.1-2-gfad0