<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.&nbsp; 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>&nbsp; File "C:\Python25\pyrad\example\server.py", line 36, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; srv.Run()<br>&nbsp; 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.&nbsp; I searched Pyrad code, server.py, line 256, and this brought up the following:<br><br>&nbsp;&nbsp;&nbsp; def Run(self):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; """Main loop.<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; This method is the main loop for a RADIUS server. It waits<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for packets to arrive via the network and calls other methods<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; to process them.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; """<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._poll=select.poll()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._fdmap={}<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._PrepareSockets()<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while 1:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (fd, event) in self._poll.poll():<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if event==select.POLLIN:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fdo=self._fdmap[fd]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self._ProcessInput(fdo)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; except ServerPacketError, err:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logger.info("Dropping packet: " + str(err))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; except packet.PacketError, err:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; logger.info("Received a broken packet: " + str(err))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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().&nbsp; 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?&nbsp; Would appreciate any tip.&nbsp; :)<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>