Project

General

Profile

Actions

Bug #6073

closed

Error with update_binary_decoded

Added by vlad about 1 year ago. Updated 12 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
06/23/2023
Due date:
% Done:

80%

Spec Reference:

Description

When I execute update_binary_decoded an error occurs:

pySIM-shell (MF/ADF.ISIM/EF.DOMAIN)> update_binary_decoded --json-path domain ims.mnc099.mcc999.3gppnetwork.org
Traceback (most recent call last):
  File "/root/.local/lib/python3.10/site-packages/cmd2/cmd2.py", line 2399, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/root/.local/lib/python3.10/site-packages/cmd2/cmd2.py", line 2852, in onecmd
    stop = func(statement)
  File "/root/.local/lib/python3.10/site-packages/cmd2/decorators.py", line 382, in cmd_wrapper
    return func(*args_list, **kwargs)  # type: ignore[call-arg]
  File "/home/zhuravlev-v/pysim/pySim/filesystem.py", line 636, in do_update_binary_decoded
    json.loads(opts.data))
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
EXCEPTION of type 'JSONDecodeError' occurred with message: Expecting value: line 1 column 1 (char 0)


Related issues

Related to pySim - Bug #6072: Error with edit_binary_decodedResolvedlaforge06/23/2023

Actions
Actions #1

Updated by laforge about 1 year ago

  • Description updated (diff)
Actions #2

Updated by laforge about 1 year ago

  • Related to Bug #6072: Error with edit_binary_decoded added
Actions #3

Updated by laforge about 1 year ago

turns out this is actually a known problem, but one where we have no idea why it is caused:

# TS 31.103 Section 4.2.3
class EF_DOMAIN(TransparentEF):
    # FIXME: re-encode fails with "string encoding failed, expected unicode string" 
    _test_decode = [
        ( '8021696d732e6d6e633030302e6d63633733382e336770706e6574776f726b2e6f7267',
          { "domain": "ims.mnc000.mcc738.3gppnetwork.org" } ),
    ]
    class domain(BER_TLV_IE, tag=0x80):
        _construct = GreedyString("utf8")

    def __init__(self, fid='6f03', sfid=0x05, name='EF.DOMAIN', desc='Home Network Domain Name', **kwargs):
        super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
        self._tlv = EF_DOMAIN.domain
Actions #4

Updated by laforge about 1 year ago

  • Status changed from New to In Progress
  • Assignee set to laforge
Actions #5

Updated by laforge about 1 year ago

  • % Done changed from 0 to 80

Proposed fix is in https://gerrit.osmocom.org/c/pysim/+/33451 and the change https://gerrit.osmocom.org/c/pysim/+/33452 enables the unit test verifying that the encoder of EF.DOMAIN actually works now.

Actions #6

Updated by laforge 12 months ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)