@@ -4331,12 +4331,16 @@ def extension_update(
43314331 # First try root-level extension.yml
43324332 try :
43334333 m = tf .getmember ("extension.yml" )
4334- manifest_data = yaml .safe_load (tf .extractfile (m ).read ()) or {}
4334+ f = tf .extractfile (m )
4335+ if f is not None :
4336+ manifest_data = yaml .safe_load (f .read ()) or {}
43354337 except KeyError :
43364338 # Look for extension.yml in a single top-level subdirectory
43374339 members = [m for m in tf .getmembers () if m .name .endswith ("/extension.yml" ) and m .name .count ("/" ) == 1 ]
43384340 if len (members ) == 1 :
4339- manifest_data = yaml .safe_load (tf .extractfile (members [0 ]).read ()) or {}
4341+ f = tf .extractfile (members [0 ])
4342+ if f is not None :
4343+ manifest_data = yaml .safe_load (f .read ()) or {}
43404344 else :
43414345 with zipfile .ZipFile (zip_path , "r" ) as zf :
43424346 namelist = zf .namelist ()
@@ -4928,7 +4932,9 @@ def _extract_workflow_yml(archive_path: Path, archive_fmt: str) -> bytes:
49284932 with tarfile .open (archive_path , "r:gz" ) as tf :
49294933 # Try root-level first.
49304934 try :
4931- return tf .extractfile (tf .getmember ("workflow.yml" )).read ()
4935+ f = tf .extractfile (tf .getmember ("workflow.yml" ))
4936+ if f is not None :
4937+ return f .read ()
49324938 except KeyError :
49334939 pass
49344940 # Look in a single top-level subdirectory.
@@ -4937,7 +4943,9 @@ def _extract_workflow_yml(archive_path: Path, archive_fmt: str) -> bytes:
49374943 if m .name .endswith ("/workflow.yml" ) and m .name .count ("/" ) == 1
49384944 ]
49394945 if len (candidates ) == 1 :
4940- return tf .extractfile (candidates [0 ]).read ()
4946+ f = tf .extractfile (candidates [0 ])
4947+ if f is not None :
4948+ return f .read ()
49414949 else :
49424950 with zipfile .ZipFile (archive_path , "r" ) as zf :
49434951 namelist = zf .namelist ()
0 commit comments