Issue1678

classification
Title: socket.fileno() returns java org.python.core.io.SocketIO object not int
Type: behaviour Severity: normal
Components: Core Versions: 2.5.2b1
Milestone:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, kellyc2702
Priority: Keywords:

Created on 2010-11-18.15:25:27 by kellyc2702, last changed 2011-02-28.22:35:16 by amak.

Messages
msg6254 (view) Author: Kelly Campbell (kellyc2702) Date: 2010-11-18.15:25:27
socket.fileno() is documented as such:
"Return the socket’s file descriptor (a small integer)."

However, it returns the org.python.core.io.SocketIO instance.
msg6256 (view) Author: Alan Kennedy (amak) Date: 2010-11-20.16:44:15
This is an implementation detail of jython: the java platform does not support integer file descriptors in the way that C does.

See the following discussion from 2007 for a detailed discussion of why.

http://comments.gmane.org/gmane.comp.lang.jython.devel/3994
msg6258 (view) Author: Kelly Campbell (kellyc2702) Date: 2010-11-20.16:50:09
Understood. I think the documentation should be updated to reflect this.
msg6264 (view) Author: Alan Kennedy (amak) Date: 2010-11-26.17:44:48
Reopening, to remind me to document this difference with cpython.
msg6420 (view) Author: Alan Kennedy (amak) Date: 2011-02-28.22:35:15
OK, I've documented this on the socket module wiki, along with supporting references to email discussions on python-dev and jython-dev.

http://wiki.python.org/jython/NewSocketModule#socket.fileno.28.29_does_not_return_an_integer

Therefore, I am now closing this bug.
History
Date User Action Args
2011-02-28 22:35:16amaksetstatus: open -> closed
messages: + msg6420
2010-11-26 17:44:48amaksetstatus: closed -> open
messages: + msg6264
2010-11-20 16:50:09kellyc2702setmessages: + msg6258
2010-11-20 16:44:15amaksetstatus: open -> closed
assignee: amak
resolution: wont fix
messages: + msg6256
nosy: + amak
2010-11-18 15:25:27kellyc2702create