Project

General

Profile

Actions

Bug #5874

closed

pySim-shell unable to know number of records on some SIM cards

Added by laforge 8 days ago. Updated 1 day ago.

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

100%

Spec Reference:

Description

I have two SIM cards here where pySim-shell doesn't know the number of records of a file, and hence commands like read_records fail with

Traceback (most recent call last):
  File "/space/home/laforge/.local/lib/python3.11/site-packages/cmd2/cmd2.py", line 2129, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/space/home/laforge/.local/lib/python3.11/site-packages/cmd2/cmd2.py", line 2559, in onecmd
    stop = func(statement)
           ^^^^^^^^^^^^^^^
  File "/space/home/laforge/.local/lib/python3.11/site-packages/cmd2/decorators.py", line 336, in cmd_wrapper
    return func(*args_list, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/space/home/laforge/projects/git/pysim/pySim/filesystem.py", line 848, in do_read_records
    for recnr in range(1, 1 + num_of_rec):
                          ~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
EXCEPTION of type 'TypeError' occurred with message: 'unsupported operand type(s) for +: 'int' and 'NoneType''

The card in queestion renders the following result when selecting a EF:

pySIM-shell (MF/DF.EIRENE/EF.Call)> select EF.Call
-> a0a4000002 6f8a
<- 9f0f: 
-> a0c000000f 
<- 9000: 000000126f8a040017007701020103
{
    "file_descriptor": {
        "file_descriptor_byte": {
            "file_type": "working_ef",
            "structure": "linear_fixed" 
        }
    },
    "proprietary_info": {
        "available_memory": 18
    },
    "file_id": "6f8a",
    "access_conditions": "1700",
    "life_cycle_status_int": "terminated" 
}

and the following for STATUS:

pySIM-shell (MF/DF.EIRENE/EF.Call)> status
-> 80F20000ff 
<- 6c26: 
-> 80F2000026 
<- 9000: 62248202382183027fe0a5038001318a01058b03000000c60990014083010183018181020c6a
{
    "file_descriptor": {
        "file_descriptor_byte": {
            "file_type": 131
        }
    },
    "proprietary_info": {
        "available_memory": 33282
    },
    "file_id": "3821" 
}


Related issues

Related to pySim - Feature #5784: Fully suport GSM-R SIM cardsResolvedlaforge11/21/2022

Actions
Actions #1

Updated by laforge 8 days ago

Actions #2

Updated by laforge 8 days ago

  • % Done changed from 0 to 90
Actions #3

Updated by laforge 1 day ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)