]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Unconditionally use HTTPConnectionPool, and depend on a Twisted that provides it.
authorDaira Hopwood <daira@jacaranda.org>
Fri, 17 Apr 2015 20:39:01 +0000 (21:39 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Fri, 17 Apr 2015 21:31:39 +0000 (22:31 +0100)
(The dependency change only affects Windows.)

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/_auto_deps.py
src/allmydata/storage/backends/cloud/cloud_common.py

index 06e3d06725f29c84f93034894049700647b3e564..bc9dcaf535d62ffeb1abb797d6d5a283b083b983 100644 (file)
@@ -108,6 +108,8 @@ if not hasattr(sys, 'frozen'):
 # Splitting the dependencies for Windows and non-Windows helps to fix
 # <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2249> and
 # <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2028>.
+# However, this is only a short-term fix for Windows because it forces
+# us to depend on a single, quite old, version of Twisted.
 
 if sys.platform == "win32":
     install_requires += [
@@ -115,16 +117,17 @@ if sys.platform == "win32":
         #   dependency on pywin32.
         # * We also need Twisted 10.1 for the FTP frontend in order for
         #   Twisted's FTP server to support asynchronous close.
-        # * When the cloud backend lands, it will depend on Twisted 10.2.0
-        #   which includes the fix to <https://twistedmatrix.com/trac/ticket/411>.
+        # * Twisted 10.2.0 includes the fix to <https://twistedmatrix.com/trac/ticket/411>.
         # * The SFTP frontend depends on Twisted 11.0.0 to fix the SSH server
         #   rekeying bug <https://twistedmatrix.com/trac/ticket/4395>
         # * The FTP frontend depends on Twisted >=11.1.0 for
         #   filepath.Permissions
+        # * The cloud backend depends on Twisted 12.1.0 for HTTPConnectionPool.
+        # * IPv6 support will also depend on Twisted 12.1.0.
         # * We don't want Twisted >= 12.2.0 to avoid a dependency of its endpoints
         #   code on pywin32. <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2028>
         #
-        "Twisted >= 11.1.0, <= 12.1.0",
+        "Twisted == 12.1.0",
 
         # * We need Nevow >= 0.9.33 to avoid a bug in Nevow's setup.py
         #   which imported twisted at setup time.
index 6cacbaf606e34814ad91c04a64e234c60cb06dad..258caf7ada8942ea3d420e3890e61be1a82e9270 100644 (file)
@@ -6,12 +6,7 @@ import urllib
 from twisted.internet import defer, reactor, task
 from twisted.python.failure import Failure
 from twisted.web.error import Error
-from twisted.web.client import FileBodyProducer, ResponseDone, Agent
-try:
-    from twisted.web.client import HTTPConnectionPool
-except ImportError:
-    # Old version of Twisted
-    HTTPConnectionPool = None
+from twisted.web.client import FileBodyProducer, ResponseDone, Agent, HTTPConnectionPool
 from twisted.web.http_headers import Headers
 from twisted.internet.protocol import Protocol
 
@@ -708,10 +703,7 @@ class CommonContainerMixin(HTTPClientMixin, ContainerRetryMixin):
     def __init__(self, container_name, override_reactor=None):
         self._container_name = container_name
         self._reactor = override_reactor or reactor
-        if HTTPConnectionPool:
-            self._agent = Agent(self._reactor, pool=HTTPConnectionPool(self._reactor))
-        else:
-            self._agent = Agent(self._reactor)
+        self._agent = Agent(self._reactor, pool=HTTPConnectionPool(self._reactor))
         self.ServiceError = CloudServiceError
 
     def __repr__(self):