laforge has submitted this change. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email )
Change subject: osmocom.construct.PaddedBcdAdapter: Support zero-length strings
......................................................................
osmocom.construct.PaddedBcdAdapter: Support zero-length strings
We cannot use the [-1] slicing if the input string has zero length.
Fix typo in docstring while we're touching that class anyway.
Change-Id: Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16
---
M src/osmocom/construct.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/osmocom/construct.py b/src/osmocom/construct.py
index d369bc7..548f22d 100644
--- a/src/osmocom/construct.py
+++ b/src/osmocom/construct.py
@@ -262,11 +262,11 @@
return h2b(swap_nibbles(obj))
class PaddedBcdAdapter(BcdAdapter):
- """Representatin of a BCD string of potentially odd number of BCD digits,
+ """Representation of a BCD string of potentially odd number of BCD digits,
which then need to be padded at the end with an 'f' nibble."""
def _decode(self, obj, context, path):
r = super()._decode(obj, context, path)
- if r[-1] == 'f':
+ if len(r) >= 1 and r[-1] == 'f':
return r[:-1]
else:
return r
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16
Gerrit-Change-Number: 41731
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email )
Change subject: osmocom.construct.PaddedBcdAdapter: Support zero-length strings
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41731?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16
Gerrit-Change-Number: 41731
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 17:03:36 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41733?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pySim.ts_51_011.EF_SMSP: Properly handle odd-length ScAddr / TpAddr
......................................................................
pySim.ts_51_011.EF_SMSP: Properly handle odd-length ScAddr / TpAddr
As the input phone number ("address") might be of an odd length of
digits, let's use PaddedBcdAdapter to fix two problems:
1) strip any potential trailing f in decoding
2) fix truncation of last digit during encoding
Change-Id: I1e9865e172bc29b8a31c281106d903934e81c686
Depends: pyosmocom Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16
---
M pySim/ts_51_011.py
M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/41733/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41733?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1e9865e172bc29b8a31c281106d903934e81c686
Gerrit-Change-Number: 41733
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41732?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pySim/ts_51_011: Properly re-compute ScAddr length
......................................................................
pySim/ts_51_011: Properly re-compute ScAddr length
EF.SMSP contains up to two addresses: Both are stored in a fixed-length
field of 12 octets. However, the actually used size depends on the
number of digits in the respective number. Let's compute that length
field properly
Change-Id: Idef54a3545d1a5367a1efa2f0a6f7f0c1f860105
---
M pySim/ts_51_011.py
M pySim/utils.py
2 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/32/41732/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41732?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Idef54a3545d1a5367a1efa2f0a6f7f0c1f860105
Gerrit-Change-Number: 41732
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: fixeria, laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41738?usp=email )
Change subject: pySim-shell: output git hash in case get_distribution fails
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
When the repository is just cloned from current master, the version command fails with an exception. I think we should try to print at least some kind of version reference. The topmost commit hash might be an option.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41738?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I2b9038f88cfcaa07894a2f09c7f5ad8a5474083d
Gerrit-Change-Number: 41738
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:46:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Jenkins Builder has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41738?usp=email )
Change subject: pySim-shell: output git hash in case get_distribution fails
......................................................................
Patch Set 1:
(1 comment)
File pySim-shell.py:
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/pysim/+/41738/comment/8f948d97_13afc301?usp=em… :
PS1, Line 531: version = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
trailing whitespace
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41738?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I2b9038f88cfcaa07894a2f09c7f5ad8a5474083d
Gerrit-Change-Number: 41738
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:44:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No