From 3ab2e86278b03ebce2d7e174776cb3ce14336c68 Mon Sep 17 00:00:00 2001 From: "Manuel.Seeger" Date: Sun, 8 Jan 2023 10:13:31 +0100 Subject: [PATCH 1/2] Remove encoding option from JSON script. Python3 deprecates encoding options in JSON.dumps and defaults to UTF8. --- sc2reader/scripts/sc2json.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sc2reader/scripts/sc2json.py b/sc2reader/scripts/sc2json.py index d2fdb8ef..4aa75baa 100755 --- a/sc2reader/scripts/sc2json.py +++ b/sc2reader/scripts/sc2json.py @@ -15,13 +15,6 @@ def main(): default=None, help="The per-line indent to use when printing a human readable json string", ) - parser.add_argument( - "--encoding", - "-e", - type=str, - default="UTF-8", - help="The character encoding use..", - ) parser.add_argument( "path", metavar="path", @@ -34,8 +27,8 @@ def main(): factory = sc2reader.factories.SC2Factory() try: factory.register_plugin( - "Replay", toJSON(encoding=args.encoding, indent=args.indent) - ) # legacy Python + "Replay", toJSON(indent=args.indent) + ) except TypeError: factory.register_plugin("Replay", toJSON(indent=args.indent)) replay_json = factory.load_replay(args.path[0]) From 8d7c5af24d009c03b89f897de356b3e9e369fc91 Mon Sep 17 00:00:00 2001 From: "Manuel.Seeger" Date: Sun, 8 Jan 2023 10:18:12 +0100 Subject: [PATCH 2/2] Blackout --- sc2reader/scripts/sc2json.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sc2reader/scripts/sc2json.py b/sc2reader/scripts/sc2json.py index 4aa75baa..c7ba99bc 100755 --- a/sc2reader/scripts/sc2json.py +++ b/sc2reader/scripts/sc2json.py @@ -26,9 +26,7 @@ def main(): factory = sc2reader.factories.SC2Factory() try: - factory.register_plugin( - "Replay", toJSON(indent=args.indent) - ) + factory.register_plugin("Replay", toJSON(indent=args.indent)) except TypeError: factory.register_plugin("Replay", toJSON(indent=args.indent)) replay_json = factory.load_replay(args.path[0])