From 698886247f592cede824984723e78b41a0ef6b64 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 9 Jul 2024 22:48:26 +0200 Subject: [PATCH] pySim.tlv: Fix ComprTlvMeta() not passing kwargs to parent __new__ This fixes commit cdf661b24cfebb63b57405c2b55b3c42a8f277c8 "pySim.tlv.COMPR_TLV_IE: Patch comprehension bit if derived class misses it" where we introduce a comprehension-TLV specific derived metaclass, which forgets to pass the kwargs through to the parent metaclass. Change-Id: If65a8169bcf91bb2f943d0316f1140e07f0b8b8e --- pySim/cat.py | 4 ++-- pySim/tlv.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pySim/cat.py b/pySim/cat.py index 2f05b93c..d2f39f73 100644 --- a/pySim/cat.py +++ b/pySim/cat.py @@ -126,7 +126,7 @@ class Duration(COMPR_TLV_IE, tag=0x84): 'time_interval'/Int8ub) # TS 102 223 Section 8.9 -class Item(COMPR_TLV_IE, tag=0x0f): +class Item(COMPR_TLV_IE, tag=0x8f): _construct = Struct('identifier'/Int8ub, 'text_string'/GsmStringAdapter(GreedyBytes)) @@ -703,7 +703,7 @@ class SaTemplate(COMPR_TLV_IE, tag=0xA3): _construct = HexAdapter(GreedyBytes) # TS 102 223 Section 8.103 -class RefreshEnforcementPolicy(COMPR_TLV_IE, tag=0x3A): +class RefreshEnforcementPolicy(COMPR_TLV_IE, tag=0xBA): _construct = FlagsEnum(Byte, even_if_navigating_menus=0, even_if_data_call=1, even_if_voice_call=2) # TS 102 223 Section 8.104 diff --git a/pySim/tlv.py b/pySim/tlv.py index 3d7a4205..d7c68764 100644 --- a/pySim/tlv.py +++ b/pySim/tlv.py @@ -270,7 +270,7 @@ class BER_TLV_IE(TLV_IE): class ComprTlvMeta(TlvMeta): def __new__(mcs, name, bases, namespace, **kwargs): - x = super().__new__(mcs, name, bases, namespace) + x = super().__new__(mcs, name, bases, namespace, **kwargs) if x.tag: # we currently assume that the tag values always have the comprehension bit set; # let's fix it up if a derived class has forgotten about that