Message17461
Even on platforms where the underlying C libraries and associated
code in
socketmodule.c support it, socket object's .makefile() method no
longer
return "real" file objects. This breaks support for cPickle, marshal,
and
any other C modules which expect a file object as an argument.
The change initially appears in socket.py v1.36 - the changelog
entry
states:
"""
The socket module now always uses the _socketobject wrapper
class, even on
platforms which have dup(2). The makefile() method is built directly
on top
of the socket without duplicating the file descriptor, allowing timeouts
to
work properly. Includes a new test case (urllibnet) which requires
the
network resource.
Closes bug 707074.
"""
I'm not sure of the implication WRT timeouts, but the patch is very
small -
quite obviously removing the platform check which prevented the
redefinition
of the symbol socket in the exports of socket.py. It now is always
the
_socketobject class, and not the underlying _socket.socket type
(when it is
known the platform supports all functionality in _socket).
For now, I can workaround (since I don't need the timeout
semantics) by
using _socket.socket() directly (I'm on a Linux platform), but I
wondered if
this is something which can/should be addressed differently?
|
|
Date |
User |
Action |
Args |
2007-08-23 14:15:31 | admin | link | issue780354 messages |
2007-08-23 14:15:31 | admin | create | |
|