if theurl.startswith(\"http://\"): theurl = theurl[7:]
head = theurl[:theurl.find(\'/\')]
tail = theurl[theurl.find(\'/\'):]
response_code = 0
import httplib
The problem I had was with multiple requests, but BadStatusLine was only occurring between requests with more then a 5 second interval with a Keep-Alive timeout=5. I'm still uncertain why BadStatusLine was being raised instead of NotConnected. It seems that the connection also defaults to 5 when the header is missing.
The fix was conn.connect() before each request.