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

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)