Explorar el Código

Catch errors around response.read().

tags/v0.2
Ben Kurtovic hace 9 años
padre
commit
bdcbfa5327
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. +4
    -1
      earwigbot/wiki/copyvios/__init__.py

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

@@ -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)


Cargando…
Cancelar
Guardar