netcmd: bugfix: json encoder failed to call super method
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 8 Feb 2024 07:53:01 +0000 (20:53 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 16 Feb 2024 02:41:36 +0000 (02:41 +0000)
This lead to a strange recursion error when a field came up that the JSONEncoder couldn't encode.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
python/samba/netcmd/encoders.py

index 5d13f989a72bbda9b610f97824939345ffc2c4b0..7f0e41a5cb7b755aeb0fe7cbd1faaa7e7e555774 100644 (file)
@@ -50,4 +50,4 @@ class JSONEncoder(json.JSONEncoder):
             return obj.as_sddl()
         elif getattr(obj, "__json__", None) and callable(obj.__json__):
             return obj.__json__()
-        return obj
+        return super().default(obj)