Add a stop-gap solution for AssertionError when retrying downloads

See #3847
This commit is contained in:
Florian Bruhin 2018-05-03 14:52:10 +02:00
parent 2b6b4e82a7
commit 979b7cfaba
2 changed files with 6 additions and 1 deletions

View File

@ -90,6 +90,7 @@ Fixed
- `@match` in Greasemonkey scripts now more closely matches the proper pattern
syntax.
- Searching via `/` or `?` now doesn't handle any characters in a special way.
- Fixed crash when trying to retry some failed downloads on QtWebEngine.
v1.2.1
------

View File

@ -101,7 +101,11 @@ class DownloadItem(downloads.AbstractDownloadItem):
def retry(self):
state = self._qt_item.state()
assert state == QWebEngineDownloadItem.DownloadInterrupted, state
if state != QWebEngineDownloadItem.DownloadInterrupted:
log.downloads.warning(
"Trying to retry download in state {}".format(
debug.qenum_key(QWebEngineDownloadItem, state)))
return
try:
self._qt_item.resume()