<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi everyone, <br><br>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:<br><br>Traceback (most recent call last):<br> File "C:\Python25\pyrad\example\server.py", line 36, in <module><br> srv.Run()<br> File "C:\Python25\pyrad\example\server.py", line 256, in Run<br><br>AttributeError: 'module' object has no attribute 'poll'<br><br>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:<br><br> def Run(self):<br> """Main loop.<br><br> This method is the main loop for a RADIUS server. It waits<br> for packets to arrive via the network and calls other methods<br> to process them.<br> """<br> self._poll=select.poll()<br> self._fdmap={}<br> self._PrepareSockets()<br><br> while 1:<br> for (fd, event) in self._poll.poll():<br> if event==select.POLLIN:<br> try:<br> fdo=self._fdmap[fd]<br> self._ProcessInput(fdo)<br> except ServerPacketError, err:<br> logger.info("Dropping packet: " + str(err))<br> except packet.PacketError, err:<br> logger.info("Received a broken packet: " + str(err))<br> else:<br> logger.error("Unexpected event in server main loop")<br><br><br><br>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:<br><br>TypeError: select expected at least 3 arguments, got 0<br><br>What should i do? Would appreciate any tip. :)<br><br>Rgds,<br>Joshua<br><br /><hr />Make the most of what you can do on your PC and the Web, just the way you want. <a href='http://www.get.live.com/wl/all' target='_new'>Windows Live</a></body>
</html>