summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-21 23:13:11 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-21 23:13:11 (GMT)
commit7d0a8264ff29fe8963bb1cc67debc03e7c728a98 (patch)
treebb50e8fb32745b01279619826cb5bb30f2ccac12 /Lib/urllib2.py
parent88effc1251c295b0e70961b587fe0de63bf10754 (diff)
downloadcpython-7d0a8264ff29fe8963bb1cc67debc03e7c728a98.zip
cpython-7d0a8264ff29fe8963bb1cc67debc03e7c728a98.tar.gz
cpython-7d0a8264ff29fe8963bb1cc67debc03e7c728a98.tar.bz2
Sockets facelift. APIs that could return binary data (e.g. aton() and
recv()) now return bytes, not str or str8. The socket.py code is redone; it now subclasses _socket.socket and instead of having its own _fileobject for makefile(), it uses io.SocketIO. Some stuff in io.py was moved around to make this work. (I really need to rethink my policy regarding readline() and read(-1) on raw files; and readline() on buffered files ought to use peeking(). Later.)
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 284c921..4127485 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -1085,10 +1085,8 @@ class AbstractHTTPHandler(BaseHandler):
# to read(). This weird wrapping allows the returned object to
# have readline() and readlines() methods.
- # XXX It might be better to extract the read buffering code
- # out of socket._fileobject() and into a base class.
-
r.recv = r.read
+ # XXX socket._fileobject is gone; use some class from io.py instead
fp = socket._fileobject(r, close=True)
resp = addinfourl(fp, r.msg, req.get_full_url())