Issue1803

classification
Title: _tcpsocket doesn't have 'family' attribute so accessing it on socket objects crashes with AttributeError (with patch)
Type: crash Severity: major
Components: Core, Library Versions: 2.5.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, irmen
Priority: Keywords: patch

Created on 2011-10-07.23:51:07 by irmen, last changed 2011-10-30.12:13:20 by amak.

Files
File name Uploaded Description Edit Remove
socketattributes.diff irmen, 2011-10-08.00:35:29 patch to add missing attributes
Messages
msg6660 (view) Author: Irmen de Jong (irmen) Date: 2011-10-07.23:51:06
_tcpsocket doesn't have 'family' attribute so accessing it on socket objects crashes with AttributeError

Reproduce session:

[E:\projects\Pyro4_ipv6\tests]java -jar \jython25\jython.jar
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()
>>> s.family
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "E:\jython25\Lib\socket.py", line 1268, in <lambda>
    family = property(lambda self: self._sock.family, doc="the socket family")
AttributeError: _tcpsocket instance has no attribute 'family'
>>>
msg6663 (view) Author: Irmen de Jong (irmen) Date: 2011-10-08.00:35:29
added patch that fixes the issue by defining the missing attributes in Lib/socket.py
msg6664 (view) Author: Irmen de Jong (irmen) Date: 2011-10-08.00:36:56
The patch also fixes issue #1804
msg6686 (view) Author: Alan Kennedy (amak) Date: 2011-10-30.12:13:19
Fix checked in at http://hg.python.org/jython/rev/be3145efdbb1
History
Date User Action Args
2011-10-30 12:13:20amaksetstatus: open -> closed
resolution: fixed
messages: + msg6686
2011-10-15 10:33:10amaksetassignee: amak
nosy: + amak
2011-10-09 23:13:25irmensettitle: _tcpsocket doesn't have 'family' attribute so accessing it on socket objects crashes with AttributeError -> _tcpsocket doesn't have 'family' attribute so accessing it on socket objects crashes with AttributeError (with patch)
2011-10-08 00:36:56irmensetmessages: + msg6664
2011-10-08 00:35:29irmensetfiles: + socketattributes.diff
keywords: + patch
messages: + msg6663
2011-10-07 23:51:07irmencreate