From 4055721fd4dba42d7a3ae1bd8f1211d0f6bc6098 Mon Sep 17 00:00:00 2001 From: calvin Date: Mon, 14 Apr 2008 22:33:55 +0000 Subject: [PATCH] Use internal gzip2 module Use the internal gzip replacement module gzip2 for all GzipFile handling. git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3685 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/checker/httpurl.py | 5 ++--- linkcheck/robotparser2.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index 1d6133b3..2faecabe 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -28,13 +28,13 @@ import cStringIO as StringIO import Cookie import linkcheck.url -import linkcheck.gzip2 import linkcheck.strformat import linkcheck.robotparser2 import linkcheck.httplib2 import httpheaders as headers import internpaturl import proxysupport +from linkcheck import gzip2 as gzip # import warnings from const import WARN_HTTP_ROBOTS_DENIED, WARN_HTTP_NO_ANCHOR_SUPPORT, \ WARN_HTTP_WRONG_REDIRECT, WARN_HTTP_MOVED_PERMANENT, \ @@ -576,8 +576,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport): if encoding == 'deflate': f = StringIO.StringIO(zlib.decompress(data)) else: - f = linkcheck.gzip2.GzipFile('', 'rb', 9, - StringIO.StringIO(data)) + f = gzip.GzipFile('', 'rb', 9, StringIO.StringIO(data)) except zlib.error, msg: self.add_warning(_("Decompress error %(err)s") % {"err": str(msg)}, diff --git a/linkcheck/robotparser2.py b/linkcheck/robotparser2.py index 8b044b99..8a19433e 100755 --- a/linkcheck/robotparser2.py +++ b/linkcheck/robotparser2.py @@ -29,12 +29,12 @@ import time import socket import re import zlib -import gzip import sys import cStringIO as StringIO import linkcheck import configuration import log +from linkcheck import gzip2 as gzip __all__ = ["RobotFileParser"]