From c9d1e4ca249fa1c08c1879cc6da528c1b658cb83 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 24 Oct 2026 11:04:53 -0400 Subject: [PATCH] Report unread bytes and round-trip through JSON text in test czones The CZone test now flags any record the parser does not read to the end and passes the JSON through json.dumps/loads, as unpack and pack do, before rebuilding the binary. Co-Authored-By: Claude Opus 5.5 --- mbEditorPro2.0/mbEditorPro.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mbEditorPro2.0/mbEditorPro.py b/mbEditorPro2.0/mbEditorPro.py index dd685e2..b4784a2 100644 --- a/mbEditorPro2.0/mbEditorPro.py +++ b/mbEditorPro2.0/mbEditorPro.py @@ -295,7 +295,10 @@ def test_czones(): arc_out = ArcZone() arc_in.load_binary(in_stream) - parsed = arc_in.save_json() + unread = len(data) - in_stream.buffer.tell() + if unread: + print(res_id, 'unread bytes:', unread) + parsed = json.loads(json.dumps(arc_in.save_json())) arc_out.load_json(parsed) arc_out.save_binary(out_stream) try: