Code review comment for lp://staging/~cody-somerville/offspring/fix-offspring-on-python2.7

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

Python2.7 adds support to xmlrpclib for HTTP/1.1 - specifically gzip encoding and keep-alive. To support the latter, make_connection needs to return the same connection if one is available. Our subclass does not do this (so does not support keep-alive) but the 'close' method added to the parent class expects it to be present so added that line pro-actively to prevent it from throwing an exception.

The code we'd need to add to the top of our make_connection method to support keep-alive (and not break python2.6) is as follows in case we ever want to add it:

        # Return an existing connection if possible for HTTP/1.1 keep-alive
        if hasattr(self, '_connection') and host == self._connection[0]:
            return self._connection[1]

« Back to merge proposal