This question has been asked before but it was two years ago and I want to know that has there been any update regarding this in python 2.7.11?
Basically my program hangs for several hours and when i do a keyboard interrupt i get this error:
File "/usr/lib/python2.7/ssl.py", line 579, in __init__
self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 808, in do_handshake
self._sslobj.do_handshake()
Does anyone has any idea why is this happening? As self-answered by Matt Vukas in the fore-mentioned thread, I scanned this thread but i don't get what's the error is about in the first place. I started python a couple of weeks ago and this is all new to me.
As as far as my memory serves me, it's not an exception so try/catch
is out of question.
One more thing I'd like to mention (which may or may not matter) is that there is no specific pattern for this, sometimes it happens after days. Sometime just 10 minutes after I've restarted the program.
URL changes after every call.
Here's the code:
username = "foobar"
password = "123456"
url = http://api.example.com
try:
r = requests.get(url, auth=(username, password))
except requests.exceptions.ConnectionError:
time.sleep(2)
self.requests_exception_error(url)
EDIT: As asked by @Sasha Pachev here's the strace.out file (Last entry to database is at line #128
And last print statement is at line #285
) The program froze at line #430
.
When the program freezes the python deamon ends automatically