I have some code in a Django view that makes a request on another server. It uses urllib2 to make an SSL connection to the server and request a page. Here's the code:
authb64 = ('%s:%s' % (username, password)).encode('base64').strip() req = urllib2.Request('https://'+url) req.add_header("Authorization", "Basic " + authb64) page = urllib2.urlopen(req) data = page.read() When I run this in Django, I usually (but not always!) get an exception: <urlopen error (2, 'The operation did not complete (read)')> from the urlopen call. Occasionally, it will work and return the data properly. This exact same code run in a standalone script succeeds 100% of the time, even when called repeatedly in a tight loop. I'm using Python 2.4.1. My earlier researches into this problem found a recurring bug in Python having to do with socket.settimeout or something. Does this ring any bells? --Ned. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---