title: Why is my Python ircbot stopping at NOTICE * :*** Looking up your hostname... and won't join a channel?
body: <p>My irc bot is hanging at :calvino.freenode.net "NOTICE * :<em>*</em> Looking up your hostname..." It was working before I added some functions to my code. I've since commented those functions out, but it's still not working!
  It stays at that message, doesn't progress. I have to force it to quit.</p>
  
  <p>I'm a very novice coder, I only started to code two weeks or so ago. So it's totally possible that I have a very stupid error there somewhere.
  For reference, I used this post to write the framework of my bot. <a href="http://ubuntuforums.org/showpost.php?p=9363159&amp;postcount=3" rel="nofollow">http://ubuntuforums.org/showpost.php?p=9363159&amp;postcount=3</a>
  I didn't post the rest of my code but I've put it in this pastebin, in case it is needed! <a href="http://pastebin.com/kVF04UFr" rel="nofollow">http://pastebin.com/kVF04UFr</a></p>
  
  <pre><code>    import socket
      import urllib2
      import httplib
      import mechanize
  
      channel = '#testbot'
      botnick = 'tastybot'
      network = 'irc.freenode.net'
      port = 6667
      irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
      irc.connect ( ( network, port ) )
      print irc.recv ( 4096 )
      irc.send ( 'NICK' + botnick + ':\r\n' )
      irc.send ( 'USER tastybot tastybot tastybot :Python IRC\r\n' )
      irc.send ( 'JOIN' + channel + ':\r\n' )
      irc.send ( 'PRIVMSG' + channel + ':What\'s up?\r\n' )
      running = True
  
      [various functions]
  
      while running:
          [rest of code]
  </code></pre>