Issue1804

classification
Title: _tcpsocket doesn't have 'type' and 'proto' attributes so accessing these on socket objects crashes with AttributeError
Type: crash Severity: major
Components: Core, Library Versions: 2.5.2
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, irmen
Priority: Keywords:

Created on 2011-10-08.00:02:00 by irmen, last changed 2011-11-02.22:36:19 by irmen.

Messages
msg6661 (view) Author: Irmen de Jong (irmen) Date: 2011-10-08.00:02:00
_tcpsocket doesn't have 'type' and 'proto' attributes so accessing these on socket objects crashes with AttributeError

Reproduce session:

[E:\Projects]\jython25\jython.bat
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_26
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.type
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "E:\jython25\Lib\socket.py", line 1269, in <lambda>
    type = property(lambda self: self._sock.type, doc="the socket type")
AttributeError: _tcpsocket instance has no attribute 'type'
>>> s.proto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "E:\jython25\Lib\socket.py", line 1270, in <lambda>
    proto = property(lambda self: self._sock.proto, doc="the socket protocol")
AttributeError: _tcpsocket instance has no attribute 'proto'
>>>
msg6662 (view) Author: Irmen de Jong (irmen) Date: 2011-10-08.00:33:27
same cause as #1803 (missing attributes in Lib/socket.py _tcpsocket and _udpsocket)
msg6687 (view) Author: Alan Kennedy (amak) Date: 2011-10-30.12:13:44
Fix checked in at http://hg.python.org/jython/rev/be3145efdbb1
msg6692 (view) Author: Irmen de Jong (irmen) Date: 2011-11-02.22:36:19
thanks.
History
Date User Action Args
2011-11-02 22:36:19irmensetmessages: + msg6692
2011-10-30 12:13:44amaksetstatus: open -> closed
resolution: fixed
messages: + msg6687
2011-10-15 10:33:24amaksetassignee: amak
nosy: + amak
2011-10-08 00:33:28irmensetmessages: + msg6662
2011-10-08 00:02:00irmencreate