Ticket #9857: 9857.patch

File 9857.patch, 811 bytes (added by Antonis Christofides, 16 years ago)

Patch that adds a 10-second timeout

  • django/forms/fields.py

     
    558558            return value
    559559        if self.verify_exists:
    560560            import urllib2
     561            import socket
    561562            headers = {
    562563                "Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
    563564                "Accept-Language": "en-us,en;q=0.5",
     
    565566                "Connection": "close",
    566567                "User-Agent": self.user_agent,
    567568            }
     569            socket.setdefaulttimeout(10)
    568570            try:
    569571                req = urllib2.Request(value, None, headers)
    570572                u = urllib2.urlopen(req)
Back to Top