title: Connection to Twitch IRC fails without good reason in Python
body: <p>I am currently trying to read messages cat channels Twitch. For this, I have read some guides and I learned it had to go through the IRC Twitch. I then found a few lines of simple code.</p>
  
  <pre><code>import socket
  import string
  
  HOST="irc.twitch.tv"
  PORT=6667
  NICK="TwitchUsername"
  IDENT="TwitchUsername"
  REALNAME="TwitchUsername"
  CHANNEL="#ChannelNameHere"
  PASSWORD="OAuth Password here" #From http://twitchapps.com/tmi/
  readbuffer=""
  
  s=socket.socket( )
  s.connect((HOST, PORT))
  s.send("PASS %s\r\n" % PASSWORD)
  s.send("NICK %s\r\n" % NICK)
  s.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
  s.send("JOIN %s\r\n" % CHANNEL)
  
  while 1:
      readbuffer=readbuffer+s.recv(1024)
      temp=string.split(readbuffer, "\n")
      readbuffer=temp.pop( )
  
      for line in temp:
          line=string.rstrip(line)
          line=string.split(line)
          if len(line) &gt; 3:
              print line
          if(line[0]=="PING"):
              s.send("PONG %s\r\n" % line[1])
  </code></pre>
  
  <p>However, authentication does not proceed as planned, since I get the following message:</p>
  
  <pre><code>[':tmi.twitch.tv', 'NOTICE', '*', ':Login', 'unsuccessful']
  </code></pre>
  
  <p>I am using a valid OAuth Chat Password, and I see no reason that justifies this failure. Do you also have an error when you try with your username? Or do you have an idea of ​​the problem please?</p>