classification
Title: Can't use sockets in 2.5b1
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arigo, bos, loewis (3)
Priority: normal Keywords:

Created on 2006-06-24 23:28 by bos, last changed 2006-07-07 06:18 by bos.

Messages (4)
msg28890 - (view) Author: Bryan O'Sullivan (bos) Date: 2006-06-24 23:28
I'm testing Mercurial with Python 2.5b1, and I am getting severe badness in the socket module, complaining that _socket.socket doesn't have a recv_into method.

+  File "/tmp/hgtests.u_b_G-/install/lib/python/mercurial/httprangereader.py", line 24, in read
+    f = urllib2.urlopen(req)
+  File "/export/home/bos/src/py25/lib/python2.5/urllib2.py", line 121, in urlopen
+    return _opener.open(url, data)
+  File "/export/home/bos/src/py25/lib/python2.5/urllib2.py", line 374, in open
+    response = self._open(req, data)
+  File "/export/home/bos/src/py25/lib/python2.5/urllib2.py", line 392, in _open+    '_open', req)
+  File "/export/home/bos/src/py25/lib/python2.5/urllib2.py", line 353, in _call_chain
+    result = func(*args)
+  File "/export/home/bos/src/py25/lib/python2.5/urllib2.py", line 1099, in http_open
+    return self.do_open(httplib.HTTPConnection, req)
+  File "/export/home/bos/src/py25/lib/python2.5/urllib2.py", line 1071, in do_open
+    h.request(req.get_method(), req.get_selector(), req.data, headers)
+  File "/export/home/bos/src/py25/lib/python2.5/httplib.py", line 862, in request
+    self._send_request(method, url, body, headers)
+  File "/export/home/bos/src/py25/lib/python2.5/httplib.py", line 885, in _send_request
+    self.endheaders()
+  File "/export/home/bos/src/py25/lib/python2.5/httplib.py", line 856, in endheaders
+    self._send_output()
+  File "/export/home/bos/src/py25/lib/python2.5/httplib.py", line 728, in _send_output
+    self.send(msg)
+  File "/export/home/bos/src/py25/lib/python2.5/httplib.py", line 695, in send
+    self.connect()
+  File "/export/home/bos/src/py25/lib/python2.5/httplib.py", line 666, in connect
+    self.sock = socket.socket(af, socktype, proto)
+  File "/export/home/bos/src/py25/lib/python2.5/socket.py", line 154, in __init__
+    self.recv_into = self._sock.recv_into
+AttributeError: '_socket.socket' object has no attribute 'recv_into'
msg28891 - (view) Author: Armin Rigo (arigo) Date: 2006-06-25 09:38
Logged In: YES 
user_id=4771

This looks like a broken install.  The socket objects
do have a recv_into() method in socketmodule.c.  Try "make
clean; make".  If it does not help, check where the _socket
module comes from with:

python2.5
>>> import _socket
>>> print _socket.__file__

and make sure that this file is among the ones you just
recompiled.
msg28892 - (view) Author: Martin v. Löwis (loewis) Date: 2006-06-29 18:46
Logged In: YES 
user_id=21627

Also, please report what operating system this is on.
msg28893 - (view) Author: Bryan O'Sullivan (bos) Date: 2006-07-07 06:18
Logged In: YES 
user_id=28380

I can't reproduce this with 2.5b1, so it was either some
strange pilot error, or it's been magically resolved.

By the way, this was on Linux, FC5.
History
Date User Action Args
2006-06-24 23:28:20boscreate