summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-03-23 13:27:29 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-03-23 13:27:29 (GMT)
commita8ddae61496de68b3c70d8dab364a204f53c153b (patch)
tree93650713040f6c37a173fd60a34e52889fa5e422
parentfe048e8ee77bac147bee87c0cddc3c8524d6b7a1 (diff)
downloadcpython-a8ddae61496de68b3c70d8dab364a204f53c153b.zip
cpython-a8ddae61496de68b3c70d8dab364a204f53c153b.tar.gz
cpython-a8ddae61496de68b3c70d8dab364a204f53c153b.tar.bz2
Bug #978833: Revert r50844, as it broke _socketobject.dup.
-rw-r--r--Lib/httplib.py4
-rw-r--r--Lib/socket.py3
-rw-r--r--Misc/NEWS2
3 files changed, 4 insertions, 5 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 5ae5efc..403e4ee 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -926,8 +926,8 @@ class HTTPConnection:
self.__state = _CS_IDLE
if response.will_close:
- # Pass the socket to the response
- self.sock = None
+ # this effectively passes the connection to the response
+ self.close()
else:
# remember this, so we can tell when it is complete
self.__response = response
diff --git a/Lib/socket.py b/Lib/socket.py
index b4969bd..0082e76 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -139,8 +139,6 @@ class _closedsocket(object):
__slots__ = []
def _dummy(*args):
raise error(EBADF, 'Bad file descriptor')
- def close(self):
- pass
# All _delegate_methods must also be initialized here.
send = recv = recv_into = sendto = recvfrom = recvfrom_into = _dummy
__getattr__ = _dummy
@@ -159,7 +157,6 @@ class _socketobject(object):
setattr(self, method, getattr(_sock, method))
def close(self):
- self._sock.close()
self._sock = _closedsocket()
dummy = self._sock._dummy
for method in _delegate_methods:
diff --git a/Misc/NEWS b/Misc/NEWS
index 7ba9dd2..5798779 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -217,6 +217,8 @@ Extension Modules
Library
-------
+- Bug #978833: Revert r50844, as it broke _socketobject.dup.
+
- Bug #1675967: re patterns pickled with Python 2.4 and earlier can
now be unpickled with Python 2.5.