瀏覽代碼

Catch errors around response.read().

tags/v0.2
Ben Kurtovic 10 年之前
父節點
當前提交
bdcbfa5327
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      earwigbot/wiki/copyvios/__init__.py

+ 4
- 1
earwigbot/wiki/copyvios/__init__.py 查看文件

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


Loading…
取消
儲存