But I feel the cause of this error is elsewhere, maybe in Fetcher.run(), where item.setNextURL() is called.
FetcherItem.setNextURL calls self._urlobj.set() with next mirror URL and that sets also self._urlobj.original to given URL (why ???).
But self._urlobj.original is passed as a parameter to Progress.setSubDone() and there it's used as a key in __subprogress dictionary.
If FetcherItem.__progress.setSubDone() is called before calling FetcherItem.progress() or FetcherItem.updateSpeed(), the dictionary item with key self._urlobj.original is not created and KeyError is thrown.
I'd like to fix this bug but don't know how to do it right.
Apparently, I can use this to silence the error:
def setSubDone(self, subkey):
return
...
if not subkey in self.__subprogress:
...
or:
(subcurrent , subtotal,
fragment, subdata) = self.__ subprogress. setdefault( subkey, (0, 0, 0, {}))
...
...
But I feel the cause of this error is elsewhere, maybe in Fetcher.run(), where item.setNextURL() is called. setNextURL calls self._urlobj.set() with next mirror URL and that sets also self._urlobj. original to given URL (why ???). original is passed as a parameter to Progress. setSubDone( ) and there it's used as a key in __subprogress dictionary. __progress. setSubDone( ) is called before calling FetcherItem. progress( ) or FetcherItem. updateSpeed( ), the dictionary item with key self._urlobj. original is not created and KeyError is thrown.
FetcherItem.
But self._urlobj.
If FetcherItem.
Does it make sense or am I missing anything ?