summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.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/urllib.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/urllib.py')
-rw-r--r--Lib/urllib.py28
1 files changed, 1 insertions, 27 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 7b2f1f7..cecfbb0 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -35,7 +35,7 @@ __all__ = ["urlopen", "URLopener", "FancyURLopener", "urlretrieve",
"localhost", "thishost", "ftperrors", "basejoin", "unwrap",
"splittype", "splithost", "splituser", "splitpasswd", "splitport",
"splitnport", "splitquery", "splitattr", "splitvalue",
- "splitgophertype", "getproxies"]
+ "getproxies"]
__version__ = '1.17' # XXX This version is not always updated :-(
@@ -433,24 +433,6 @@ class URLopener:
return self.http_error(url, fp, errcode, errmsg, headers,
data)
- def open_gopher(self, url):
- """Use Gopher protocol."""
- if not isinstance(url, str):
- raise IOError, ('gopher error', 'proxy support for gopher protocol currently not implemented')
- import gopherlib
- host, selector = splithost(url)
- if not host: raise IOError, ('gopher error', 'no host given')
- host = unquote(host)
- 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(), "gopher:" + url)
-
def open_file(self, url):
"""Use local file or FTP depending on form of URL."""
if not isinstance(url, str):
@@ -981,7 +963,6 @@ class addinfourl(addbase):
# splitattr('/path;attr1=value1;attr2=value2;...') ->
# '/path', ['attr1=value1', 'attr2=value2', ...]
# splitvalue('attr=value') --> 'attr', 'value'
-# splitgophertype('/Xselector') --> 'X', 'selector'
# unquote('abc%20def') -> 'abc def'
# quote('abc def') -> 'abc%20def')
@@ -1141,12 +1122,6 @@ def splitvalue(attr):
if match: return match.group(1, 2)
return attr, None
-def splitgophertype(selector):
- """splitgophertype('/Xselector') --> 'X', 'selector'."""
- if selector[:1] == '/' and selector[1:2]:
- return selector[1], selector[2:]
- return None, selector
-
_hextochr = dict(('%02x' % i, chr(i)) for i in range(256))
_hextochr.update(('%02X' % i, chr(i)) for i in range(256))
@@ -1482,7 +1457,6 @@ def test(args=[]):
'file:/etc/passwd',
'file://localhost/etc/passwd',
'ftp://ftp.gnu.org/pub/README',
-## 'gopher://gopher.micro.umn.edu/1/',
'http://www.python.org/index.html',
]
if hasattr(URLopener, "open_https"):