[python-win32] Welcome to the "python-win32" mailing list

Joshua Lim joshua__lim at hotmail.com
Sat Dec 27 20:36:01 CET 2008


Hi everyone, 

I'm new to python or C.  I've been trying to get open source pyrad, a socket radius python app, to work on win32, and encountered an error:

Traceback (most recent call last):
  File "C:\Python25\pyrad\example\server.py", line 36, in <module>
    srv.Run()
  File "C:\Python25\pyrad\example\server.py", line 256, in Run

AttributeError: 'module' object has no attribute 'poll'

A quick Google revealed that the error has something to do with Linux poll not working under windows.  I searched Pyrad code, server.py, line 256, and this brought up the following:

    def Run(self):
        """Main loop.

        This method is the main loop for a RADIUS server. It waits
        for packets to arrive via the network and calls other methods
        to process them.
        """
        self._poll=select.poll()
        self._fdmap={}
        self._PrepareSockets()

        while 1:
            for (fd, event) in self._poll.poll():
                if event==select.POLLIN:
                    try:
                        fdo=self._fdmap[fd]
                        self._ProcessInput(fdo)
                    except ServerPacketError, err:
                                                logger.info("Dropping packet: " + str(err))
                    except packet.PacketError, err:
                        logger.info("Received a broken packet: " + str(err))
                else:
                                        logger.error("Unexpected event in server main loop")



As i understand, i need to change the code to use select.select().  I tried replacing "select.poll()" with "select.select()" but got a new error:

TypeError: select expected at least 3 arguments, got 0

What should i do?  Would appreciate any tip.  :)

Rgds,
Joshua

_________________________________________________________________
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20081227/31d9d4d1/attachment.htm>


More information about the python-win32 mailing list