mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-12 16:43:11 +00:00
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
This commit is contained in:
parent
17cd16185f
commit
4055721fd4
2 changed files with 3 additions and 4 deletions
|
|
@ -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)},
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue