From 763272eb5a2db9bb0e0bbefe367db9e5b8efee09 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 20 Jun 2024 10:37:02 +0200 Subject: [PATCH 1/2] fix encoding of non byte-aligned reserved parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `encode_state.emplace_bytes()` only works if the bit position is zero... Signed-off-by: Andreas Lauser Signed-off-by: Katja Köhler --- odxtools/parameters/reservedparameter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odxtools/parameters/reservedparameter.py b/odxtools/parameters/reservedparameter.py index 87967d60..8018896e 100644 --- a/odxtools/parameters/reservedparameter.py +++ b/odxtools/parameters/reservedparameter.py @@ -53,6 +53,7 @@ def _encode_positioned_into_pdu(self, physical_value: Optional[ParameterValue], encode_state: EncodeState) -> None: encode_state.cursor_byte_position += (encode_state.cursor_bit_position + self.bit_length + 7) // 8 + encode_state.cursor_bit_position = 0 encode_state.emplace_bytes(b'', self.short_name) @override From ad826ddadfc53832dbdb297da625e0228e1b010c Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 20 Jun 2024 11:00:56 +0200 Subject: [PATCH 2/2] fix deprecation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is the same patch as Randy Döring's #315 which we unfortunately cannot merge because Randy cannot sign the CLA. Signed-off-by: Andreas Lauser Signed-off-by: Katja Köhler --- odxtools/exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odxtools/exceptions.py b/odxtools/exceptions.py index 4645c266..aaf29f59 100644 --- a/odxtools/exceptions.py +++ b/odxtools/exceptions.py @@ -40,7 +40,7 @@ def odxraise(message: Optional[str] = None, error_type: Type[Exception] = OdxErr else: raise error_type(message) elif message is not None: - logger.warn(message) + logger.warning(message) def odxassert(condition: bool,