File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,6 @@ def _get_installed_standard_pip_packages():
135
135
flag_custom_sdkonfig = False
136
136
flag_custom_component_add = False
137
137
flag_custom_component_remove = False
138
- removed_components = set ()
139
138
140
139
IDF5 = (
141
140
platform .get_package_version ("framework-espidf" )
@@ -220,18 +219,22 @@ def load_custom_sdkconfig_file():
220
219
response = requests .get (file_entry .split (" " )[0 ])
221
220
if response .ok :
222
221
return response .content .decode ('utf-8' )
223
- except Exception as e :
222
+ except requests . RequestException as e :
224
223
print (f"Error downloading { file_entry } : { e } " )
224
+ except UnicodeDecodeError as e :
225
+ print (f"Error decoding response from { file_entry } : { e } " )
225
226
return ""
226
227
227
228
# Handle local files
228
229
if "file://" in file_entry :
229
- file_path = join (PROJECT_DIR , file_entry .lstrip ("file://" ).split (os .path .sep )[- 1 ])
230
+ file_ref = file_entry [7 :] if file_entry .startswith ("file://" ) else file_entry
231
+ filename = os .path .basename (file_ref )
232
+ file_path = join (PROJECT_DIR , filename )
230
233
if os .path .exists (file_path ):
231
234
try :
232
235
with open (file_path , 'r' ) as f :
233
236
return f .read ()
234
- except Exception as e :
237
+ except IOError as e :
235
238
print (f"Error reading file { file_path } : { e } " )
236
239
return ""
237
240
else :
You can’t perform that action at this time.
0 commit comments