From 39613da6a74ac694550d5b0f24f1546923c6867b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 17 Aug 2024 10:12:58 +0200 Subject: [PATCH] pySim.esim.saip: Fix key used in FsProfileElement.files2pe The self.files member is a dict. Hence we should use those dict keys when [re]building the decoded dict. The previous code ignored it and re-constructed the key from File.pe_name - but that's not always identical. Change-Id: I0e6c97721fb1cfc6b5c21595d85bd374d485b573 --- pySim/esim/saip/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 037f7cc7..20e2cb4e 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -371,9 +371,9 @@ class FsProfileElement(ProfileElement): self.files[file.pe_name] = file def files2pe(self): - """Update the "decoded" member with the contents of the files member.""" - for f in self.files: - self.decoded[f.pename] = f.to_tuples() + """Update the "decoded" member with the contents of the "files" member.""" + for k, f in self.files.items(): + self.decoded[k] = f.to_tuples() def pe2files(self): """Update the "files" member with the contents of the "decoded" member."""