From 9f9ec905e807e73149ce78a08ab5a02786d25a4a Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Thu, 28 May 2020 07:56:51 -0700 Subject: [PATCH] Catch IOError exception when trying to read the SeedCatalogs.plist; print any errors around SeedCatalogs.plist access to stderr. --- installinstallmacos.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/installinstallmacos.py b/installinstallmacos.py index 360ea48..4964554 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -98,7 +98,8 @@ def get_seeding_program(sucatalog_url): if sucatalog_url == value: return key return '' - except (OSError, ExpatError, AttributeError, KeyError): + except (OSError, IOError, ExpatError, AttributeError, KeyError) as err: + print(err, file=sys.stderr) return '' @@ -107,7 +108,8 @@ def get_seed_catalog(seedname='DeveloperSeed'): try: seed_catalogs = read_plist(SEED_CATALOGS_PLIST) return seed_catalogs.get(seedname) - except (OSError, ExpatError, AttributeError, KeyError): + except (OSError, IOError, ExpatError, AttributeError, KeyError) as err: + print(err, file=sys.stderr) return '' @@ -116,7 +118,8 @@ def get_seeding_programs(): try: seed_catalogs = read_plist(SEED_CATALOGS_PLIST) return list(seed_catalogs.keys()) - except (OSError, ExpatError, AttributeError, KeyError): + except (OSError, IOError, ExpatError, AttributeError, KeyError) as err: + print(err, file=sys.stderr) return ''