Ver a proveniência

Catch errors around response.read().

tags/v0.2
Ben Kurtovic há 9 anos
ascendente
cometimento
bdcbfa5327
1 ficheiros alterados com 4 adições e 1 eliminações
  1. +4
    -1
      earwigbot/wiki/copyvios/__init__.py

+ 4
- 1
earwigbot/wiki/copyvios/__init__.py Ver ficheiro

@@ -210,7 +210,10 @@ class _CopyvioWorker(object):
return None

with self._workspace.request_semaphore:
content = response.read()
try:
content = response.read()
except (URLError, error):
return None

if response.headers.get("Content-Encoding") == "gzip":
stream = StringIO(content)


Carregando…
Cancelar
Guardar