Browse Source

Catch errors around response.read().

tags/v0.2
Ben Kurtovic 10 years ago
parent
commit
bdcbfa5327
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      earwigbot/wiki/copyvios/__init__.py

+ 4
- 1
earwigbot/wiki/copyvios/__init__.py View File

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


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


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


Loading…
Cancel
Save