From a471d9f344335cac250e7c0d3f39db551671990f Mon Sep 17 00:00:00 2001 From: Bastian Eicher Date: Thu, 21 Jun 2012 15:24:20 +0200 Subject: [PATCH] Fixed bug with external store when type or extract is not given Do not try to pass None as process arguments in fetch._add_to_external_store: default extract directory to empty string, default MIME type to MIME type guess based on URL. --- zeroinstall/injector/fetch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zeroinstall/injector/fetch.py b/zeroinstall/injector/fetch.py index c6ba33d..947a037 100644 --- a/zeroinstall/injector/fetch.py +++ b/zeroinstall/injector/fetch.py @@ -381,10 +381,12 @@ class Fetcher(object): type = retrieval_method.type, start_offset = retrieval_method.start_offset or 0) def _add_to_external_store(self, required_digest, steps, streams): + from zeroinstall.zerostore.unpack import type_from_url + # combine archive path, extract directory and MIME type arguments in an alternating fashion paths = map(lambda stream: stream.name, streams) - extracts = map(lambda step: step.extract, steps) - types = map(lambda step: step.type, steps) + extracts = map(lambda step: step.extract or "", steps) + types = map(lambda step: step.type or type_from_url(step.url), steps) args = [None]*(len(paths)+len(extracts)+len(types)) args[::3] = paths args[1::3] = extracts -- 2.11.4.GIT