On Thu, 2013-01-17 at 16:35 +0100, Zdenek Pavlas wrote: > repo_gen_decompress(cached=True) returns the name > of uncompressed file without checking/creating it. > That's probably fine, the '_db' path handles this. > > Add an exists() check to 'xml' path, so RepoError > is raised instead of TypeError from y-m-p. > --- > yum/yumRepo.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/yum/yumRepo.py b/yum/yumRepo.py > index 02778dd..1196ae2 100644 > --- a/yum/yumRepo.py > +++ b/yum/yumRepo.py > @@ -211,7 +211,7 @@ class YumPackageSack(packageSack.PackageSack): > # parser doesn't understand. > gen = mymdtype + '.xml' > ret = misc.repo_gen_decompress(xml, gen, cached=repo.cache) > - if not ret: > + if not (ret and os.path.exists(ret)): > raise Errors.RepoError, '%s: Decompress DB failed' % repo > xml = ret > # Convert XML => .sqlite
It seems like the os.path.exists() check should go in repo_gen_decompress() and have that return None instead? All the other callers looked like they'd also prefer to get None back than a filename that doesn't exist.
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Yum-devel mailing list Yum-devel@lists.baseurl.org http://lists.baseurl.org/mailman/listinfo/yum-devel