From 5931f375debb858d83047727c45e64cb2d835e67 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 11 Jun 2013 21:03:17 -0400 Subject: [PATCH] Put response.read() in the try:, since that's what throws the timeout. --- earwigbot/wiki/copyvios/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earwigbot/wiki/copyvios/__init__.py b/earwigbot/wiki/copyvios/__init__.py index 759f43c..8b906f9 100644 --- a/earwigbot/wiki/copyvios/__init__.py +++ b/earwigbot/wiki/copyvios/__init__.py @@ -63,9 +63,9 @@ class CopyvioMixIn(object): """ try: response = self._opener.open(url.encode("utf8"), timeout=5) + result = response.read() except (URLError, timeout): return None - result = response.read() if response.headers.get("Content-Encoding") == "gzip": stream = StringIO(result)