Ticket #6499: fix-python3-and-ssl.patch

File fix-python3-and-ssl.patch, 1.6 KB (added by Hynek Schlawack, 8 years ago)

Fix Python 3.3 & pyOpenSSL regression.

  • twisted/internet/test/test_endpoints.py

    diff --git twisted/internet/test/test_endpoints.py twisted/internet/test/test_endpoints.py
    index a8e83a2..3ae009b 100644
    class ServerStringTests(unittest.TestCase): 
    18381838        self.assertIsInstance(ctx, ContextType)
    18391839
    18401840
    1841     if not skipSSL:
    1842         # Use a class variable to ensure we use the exactly same endpoint
    1843         # string except for the chain file itself.
    1844         SSL_CHAIN_TEMPLATE = ("ssl:1234:privateKey=%s:extraCertChain=%%s"
    1845                               % (escapedPEMPathName,))
     1841    # Use a class variable to ensure we use the exactly same endpoint string
     1842    # except for the chain file itself.
     1843    SSL_CHAIN_TEMPLATE = "ssl:1234:privateKey=%s:extraCertChain=%s"
    18461844
    18471845
    18481846    def test_sslChainLoads(self):
    class ServerStringTests(unittest.TestCase): 
    18521850        """
    18531851        server = endpoints.serverFromString(
    18541852            object(),
    1855             self.SSL_CHAIN_TEMPLATE % (escapedChainPathName,)
     1853            self.SSL_CHAIN_TEMPLATE % (escapedPEMPathName,
     1854                                       escapedChainPathName,)
    18561855        )
    18571856        # Test chain file is just a concatenation of thing1.pem and thing2.pem
    18581857        # so we can check that loading has succeeded and order has been
    class ServerStringTests(unittest.TestCase): 
    18831882            ValueError,
    18841883            endpoints.serverFromString,
    18851884            object(),
    1886             self.SSL_CHAIN_TEMPLATE % (fp.path,)
     1885            self.SSL_CHAIN_TEMPLATE % (escapedPEMPathName, fp.path,)
    18871886        )
    18881887
    18891888