title: HTTP instance has no attribute getresponse Error on Python 2.6
body: <p>I was trying to do some jsonrpc calls using python. However, since the api calls need cookies, so that I create my own transport class which will be used by the jsonrpclib. This works totally fine with latest 2.7 python. However, when I try to run it on the python 2.6.6, it complains that "HTTP instance has no attribute getresponse"</p>
  
  <p>Code</p>
  
  <pre><code>class TransportMixIn(object):
      """ Just extends the XMLRPC transport where necessary. """
      user_agent = jsonrpclib.config.user_agent
      # for Python 2.7 support
      _connection = None
  
      def send_content(self, connection, request_body):
          connection.putheader("Content-Type", "application/json-rpc")
          connection.putheader("Content-Length", str(len(request_body)))
  
          if cookie != None :
              connection.putheader("Cookie",cookie)
  
          connection.endheaders()
          if request_body:
              connection.send(request_body)
  
  
      def getparser(self):
          target = JSONTarget()
          return JSONParser(target), target
  
      def request(self, host, handler, request_body, verbose=False):
          # issue XML-RPC request
          self.verbose = verbose
  
  
          try:
              h=self.make_connection(host)
              if verbose:
                  h.set_debuglevel(1)
  
              self.send_request(h,handler,request_body)
              self.send_host(h,host)
              self.send_user_agent(h)
              self.send_content(h,request_body)
              **resp = h.getresponse()**
              if resp.status == 200:
                  self.verbose = verbose
                  global cookie 
                  cookie = resp.getheader('set-cookie')
                  return self.parse_response(resp)
  
          except xmlrpclib.Fault:
              raise
          except Exception:
              #All unexpected errors leave connection in
              # a strange state, so we clear it.
              self.close()
              raise
  
          #We got an error response.
          #Discard any response data and raise exception
          if resp.getheader("content-length", ""):
              resp.read()
          raise xmlrpclib.ProtocolError(
              host + handler,
              resp.status, resp.reason,
              dict(resp.getheaders())
              )
  
  
  
  class Transport(TransportMixIn, XMLTransport):
      pass
  
  class SafeTransport(TransportMixIn, XMLSafeTransport):
      pass
  </code></pre>
  
  <p>The error occurs at the line where resp=h.getresponse()</p>
  
  <p>Any ideas??
  Btw, is python such a language that code will be easily messed up when run on different versions? Such wired behaviour has occurred to me multiple times.</p>