summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-05-16 22:42:29 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-05-16 22:42:29 (GMT)
commitd75f043c3325be6c1fdbc840a5d2358c1e8aa604 (patch)
tree107af217fc952fd66b5197545cbbcb6ba67c333e /Lib/urllib2.py
parentb1a9b37aa836f1c0f827b16cebdd23dfe19fcf4c (diff)
downloadcpython-d75f043c3325be6c1fdbc840a5d2358c1e8aa604.zip
cpython-d75f043c3325be6c1fdbc840a5d2358c1e8aa604.tar.gz
cpython-d75f043c3325be6c1fdbc840a5d2358c1e8aa604.tar.bz2
Remove the gopherlib module. It has been raising a DeprecationWarning since
Python 2.5. Also remove gopher support from urllib/urllib2. As both imported gopherlib the usage of the support would have raised a DeprecationWarning.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py24
1 files changed, 1 insertions, 23 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 6bfbc29..fe32b2d 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -107,7 +107,7 @@ except ImportError:
from StringIO import StringIO
from urllib import (unwrap, unquote, splittype, splithost, quote,
- addinfourl, splitport, splitgophertype, splitquery,
+ addinfourl, splitport, splitquery,
splitattr, ftpwrapper, noheaders, splituser, splitpasswd, splitvalue)
# support for FileHandler, proxies via environment variables
@@ -164,9 +164,6 @@ class HTTPError(URLError, addinfourl):
def __str__(self):
return 'HTTP Error %s: %s' % (self.code, self.msg)
-class GopherError(URLError):
- pass
-
# copied from cookielib.py
_cut_port_re = re.compile(r":\d+$")
def request_host(request):
@@ -1342,22 +1339,3 @@ class CacheFTPHandler(FTPHandler):
del self.timeout[k]
break
self.soonest = min(self.timeout.values())
-
-class GopherHandler(BaseHandler):
- def gopher_open(self, req):
- # XXX can raise socket.error
- import gopherlib # this raises DeprecationWarning in 2.5
- host = req.get_host()
- if not host:
- raise GopherError('no host given')
- host = unquote(host)
- selector = req.get_selector()
- type, selector = splitgophertype(selector)
- selector, query = splitquery(selector)
- selector = unquote(selector)
- if query:
- query = unquote(query)
- fp = gopherlib.send_query(selector, query, host)
- else:
- fp = gopherlib.send_selector(selector, host)
- return addinfourl(fp, noheaders(), req.get_full_url())