Project

General

Profile

Actions

Bug #6072

closed

Error with edit_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:

100%

Spec Reference:

Description

When I execute edit_binary_decoded, vim opens, I edit the data, save and exit, then an error occurs:

pySIM-shell (MF/ADF.ISIM/EF.DOMAIN)> set debug true
debug - was: False
now: True
pySIM-shell (MF/ADF.ISIM/EF.DOMAIN)> edit_binary_decoded
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 "/home/zhuravlev-v/pysim/pySim/filesystem.py", line 658, in do_edit_binary_decoded
    (data, sw) = self._cmd.lchan.update_binary_dec(edited_json)
  File "/home/zhuravlev-v/pysim/pySim/filesystem.py", line 1673, in update_binary_dec
    data_hex = self.selected_file.encode_hex(data)
  File "/home/zhuravlev-v/pysim/pySim/filesystem.py", line 782, in encode_hex
    return b2h(t.to_tlv())
  File "/home/zhuravlev-v/pysim/pySim/tlv.py", line 231, in to_tlv
    val = self.to_bytes()
  File "/home/zhuravlev-v/pysim/pySim/tlv.py", line 186, in to_bytes
    return super().to_bytes()
  File "/home/zhuravlev-v/pysim/pySim/tlv.py", line 95, in to_bytes
    do = self.__class__._construct.build(self.decoded, total_len=None)
  File "/root/.local/lib/python3.10/site-packages/construct/core.py", line 336, in build
    self.build_stream(obj, stream, **contextkw)
  File "/root/.local/lib/python3.10/site-packages/construct/core.py", line 348, in build_stream
    self._build(obj, stream, context, "(building)")
  File "/root/.local/lib/python3.10/site-packages/construct/core.py", line 707, in _build
    obj2 = self._encode(obj, context, path)
  File "/root/.local/lib/python3.10/site-packages/construct/core.py", line 1614, in _encode
    raise StringError("string encoding failed, expected unicode string", path=path)
construct.core.StringError: Error in path (building)
string encoding failed, expected unicode string
EXCEPTION of type 'StringError' occurred with message: Error in path (building)
string encoding failed, expected unicode string


Related issues

Related to pySim - Bug #6073: Error with update_binary_decodedResolvedlaforge06/23/2023

Actions
Actions #1

Updated by laforge about 1 year ago

can you pleas provide a copy+paste of the data after your edit, so we can
try to reproduce the problem?

It likely is a specific problem about EF.DOMAIN, as we constantly use {edit,update}_binary_decoded
on other files.

Hence we need the exact test data.

Actions #2

Updated by laforge about 1 year ago

  • Related to Bug #6073: Error with update_binary_decoded added
Actions #3

Updated by laforge about 1 year ago

  • Description updated (diff)
Actions #4

Updated by vlad about 1 year ago

laforge wrote in #note-1:

can you pleas provide a copy+paste of the data after your edit, so we can
try to reproduce the problem?

It likely is a specific problem about EF.DOMAIN, as we constantly use {edit,update}_binary_decoded
on other files.

Hence we need the exact test data.

I'm trying to change this:

{
"domain": "ims.mnc001.mcc001.3gppnetwork.org"
}
~

On to this one. And an error occurs, the result is not saved.

{
"domain": "ims.mnc001.mcc002.3gppnetwork.org"
}

But the EF.IMSI changes work fine

Actions #5

Updated by vlad about 1 year ago

laforge wrote in #note-1:

can you pleas provide a copy+paste of the data after your edit, so we can
try to reproduce the problem?

It likely is a specific problem about EF.DOMAIN, as we constantly use {edit,update}_binary_decoded
on other files.

Hence we need the exact test data.

Even if I enter this, there is an error

{
"domain": "123"
}

Actions #6

Updated by laforge 12 months ago

  • Status changed from New to Resolved
  • Assignee set to laforge
  • % Done changed from 0 to 100

actually the same underlying problem as #6072 which has been fixed meanwhile

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)