select.error 10038 with sockets in python 2.7 on windows
<p>so I wrote a simple encrypted IRC client in python 2.7.On linux,it works fine,but on windows I get this error: select.error: (10038, 'An operation was attempted on something that is not a socket').
I made some research,and I know that I can't select like that on windows,but as a newbie I don't have enough knowledge to get it work.So here's my code:</p>

<pre><code>import socket
import os 
import sys
import select
from Crypto.Cipher import ARC4
import base64

if(len(sys.argv) &lt; 3) :
    print 'Usage : python ./joczoirc.py hostname port nickname room(without the # !!!) enc_password'
    sys.exit()
server = sys.argv[1]
port = int(sys.argv[2])
botnick = sys.argv[3]
room = sys.argv[4]
enckey = sys.argv[5]
channel = '#' + room

def encrypt(key, plaintext):
  cipher = ARC4.new(key)
  return base64.b64encode(cipher.encrypt(plaintext))

def decrypt(key, ciphertext):
  cipher = ARC4.new(key)
  return cipher.decrypt(base64.b64decode(ciphertext))

irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #definialjuk a socketot
print "connecting to:"+server
irc.connect((server, port))                                                         #kapcsolodas a szerverhez
irc.send("USER "+ botnick +" "+ botnick +" "+ botnick +" :Joczo Encrypted IRC\n") #user authentication
irc.send("NICK "+ botnick +"\n")                            #sets nick
irc.send("PRIVMSG nickserv :iNOOPE\r\n")    #auth
irc.send("JOIN "+ channel +"\n")        #join the chan

while 1:
    socket_list = [1, irc]
    read_sockets, write_sockets, error_sockets = select.select(socket_list , [], [])
    for sock in read_sockets:
        if sock == irc:
            text=irc.recv(2040)
            if text.find('PING') != -1:                          #ha talal 'PING' szot
                irc.send('PONG ' + text.split() [1] + '\r\n') #viszakuldi 'PONG' szot szervernek hogy meg online van
            if text.find(':') != -1:
                before_privmsg, privmsg, after_privmsg = text.partition('PRIVMSG')
                print '[+] ' + before_privmsg
                before_uzenet, uzenet, after_uzenet = text.partition(channel+' :')
                if text.find('TITKOS') != -1:
                    before_encedmsg, encedmsg, after_encedmsg = text.partition('TITKOS')
                    demsg = decrypt(enckey,after_encedmsg)
                    print '[-] ' + demsg
                else:
                    print '[!] ' + after_uzenet
        else: 
            mymsg = sys.stdin.readline()
            encmsg = encrypt(enckey,mymsg)
            irc.send('PRIVMSG '+channel+' : TITKOS'+encmsg+'\r\n')
</code></pre>