Use None on missing required info_dict fields

This commit is contained in:
Filippo Valsorda 2012-11-27 23:15:33 +01:00
parent 03c5b0fbd4
commit f462df021a
2 changed files with 40 additions and 39 deletions

View file

@ -327,6 +327,7 @@ class FileDownloader(object):
template_dict = dict(info_dict)
template_dict['epoch'] = unicode(int(time.time()))
template_dict['autonumber'] = unicode('%05d' % self._num_downloads)
template_dict = dict((key, u'NA' if val is None else val) for key, val in template_dict.items())
filename = self.params['outtmpl'] % template_dict
return filename
except (ValueError, KeyError), err: