title: sleep() causes program to hang indefinitely
body: <p>I'm working on a mail sending python script in Linux.</p>
  <p>I can send 10 messages, then need to wait 5 - 10 minutes before sending again.</p>
  <p>I am executing the following code inside of a <code>while()</code> loop.</p>
  <pre><code>#Pausing so the MailServer doesn't complain
  delay = randint(300,600)
  now = datetime.now()
  current_time = now.strftime(&quot;%H:%M:%S&quot;)
  print(current_time + &quot; sleeping &quot; + str(timedelta(seconds=delay)))
  sleep(delay)
  </code></pre>
  <p>This causes the program to hang whether it is at the beginning of the loop or end.</p>
  <p>While stepping through with <code>pdb</code>, I can't detect the issue.</p>
  <p>I am <em>not</em> using threading (just because I haven't learned how yet).</p>
  <p>I'm open to ideas.</p>