laforge submitted this change.
pySim.runtime: Fix file selection by upper case hex FID
When trying to remove a file (e.g. DF.5G_ProSe, 5FF0),
there seems to be a case sensitive check when checking for the dict:
pySim/runtime.py: get_file_for_filename():
478 def get_file_for_filename(self, name: str):
479 """Get the related CardFile object for a specified filename."""
480 sels = self.selected_file.get_selectables()
481 return sels[name]
The dict sels contains 5ff0, but not 5FF0.
The type of argument name is str. So a case sensitive check will be used.
Change-Id: Idd0db1f4bbd3ee9eec20f5fd0f4371c2882950cd
Closes: OS#6898
---
M pySim/runtime.py
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/pySim/runtime.py b/pySim/runtime.py
index 597323f..35452a0 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -477,11 +477,15 @@
def get_file_for_filename(self, name: str):
"""Get the related CardFile object for a specified filename."""
+ if is_hex(name):
+ name = name.lower()
sels = self.selected_file.get_selectables()
return sels[name]
def activate_file(self, name: str):
"""Request ACTIVATE FILE of specified file."""
+ if is_hex(name):
+ name = name.lower()
sels = self.selected_file.get_selectables()
f = sels[name]
data, sw = self.scc.activate_file(f.fid)
To view, visit change 41579. To unsubscribe, or for help writing mail filters, visit settings.