soarpenguin / python-multiprocessing

Automatically exported from code.google.com/p/python-multiprocessing
Other
0 stars 0 forks source link

mp_webserver.py is not working on win32 #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Doc\includes\mp_webserver.py leads to:

[...]
  File "[....]\multiprocessing\reduction.py", line 167, in rebuild_socket
    _sock = fromfd(fd, family, type_, proto)
  File "[....]\multiprocessing\reduction.py", line 156, in fromfd
    s = socket.fromfd(fd, family, type_, proto)
AttributeError: 'module' object has no attribute 'fromfd'

The version of processing.py 0.52 from berlios DID work on win32. Problem
is: on win32 there is no socket.fromfd; and reduction.py is supposed to
provide a substitution (which it does NOT within multiprocessing, but
within processing)

Harald

Original issue reported on code.google.com by haraldar...@gmail.com on 28 Apr 2009 at 11:39

GoogleCodeExporter commented 9 years ago
digging down... within processsing.reduction.py contains:

try:
    fromfd = socket.fromfd
except AttributeError:
    def fromfd(fd, family, type, proto=0):
        s = socket._socket.socket()
        _processing.changeFd(s, fd, family, type, proto)
        return s

within multiprocesssing.reduction.py there is

def fromfd(fd, family, type_, proto=0):
    s = socket.fromfd(fd, family, type_, proto)
    if s.__class__ is not socket.socket:
        s = socket.socket(_sock=s)
    return s

and changeFd is no longer a method of multiprocessing :(

Harald

Original comment by haraldar...@gmail.com on 28 Apr 2009 at 11:44