From bfb9d71cc5f118378d8f4ae8de655ea0e2b27592 Mon Sep 17 00:00:00 2001 From: FriedrichFroebel Date: Wed, 15 Oct 2025 20:58:55 +0200 Subject: [PATCH 1/2] Replace deprecated codecs.open by open --- mf2py/backcompat.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mf2py/backcompat.py b/mf2py/backcompat.py index 49a866e..ad4f8cd 100644 --- a/mf2py/backcompat.py +++ b/mf2py/backcompat.py @@ -23,7 +23,6 @@ """ -import codecs import copy import json import os @@ -47,7 +46,7 @@ for filename in os.listdir(_RULES_LOC): file_path = os.path.join(_RULES_LOC, filename) root = os.path.splitext(filename)[0] - with codecs.open(file_path, "r", "utf-8") as f: + with open(file_path, "r", "utf-8") as f: rules = json.load(f) _CLASSIC_MAP[root] = rules From 87b5447d8d18fc13804d74f113eeb986e4b26936 Mon Sep 17 00:00:00 2001 From: FriedrichFroebel Date: Sat, 14 Mar 2026 10:57:07 +0100 Subject: [PATCH 2/2] use keyword arguments --- mf2py/backcompat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mf2py/backcompat.py b/mf2py/backcompat.py index ad4f8cd..5a00ffc 100644 --- a/mf2py/backcompat.py +++ b/mf2py/backcompat.py @@ -46,7 +46,7 @@ for filename in os.listdir(_RULES_LOC): file_path = os.path.join(_RULES_LOC, filename) root = os.path.splitext(filename)[0] - with open(file_path, "r", "utf-8") as f: + with open(file_path, mode="r", encoding="utf-8") as f: rules = json.load(f) _CLASSIC_MAP[root] = rules