summaryrefslogtreecommitdiff
path: root/dev-python/twisted/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-29 11:22:34 +0000
committerV3n3RiX <venerix@redcorelinux.org>2017-10-29 11:22:34 +0000
commitbd7908c6630f38067350d396ac5d18c3cc2434a0 (patch)
tree3559b3e11424f5529527f2474d8a977a91ee3389 /dev-python/twisted/files
parent8b2628ad8526c806375e7b157889e4274b70248b (diff)
gentoo resync : 29.10.2017
Diffstat (limited to 'dev-python/twisted/files')
-rw-r--r--dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch74
-rw-r--r--dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch47
2 files changed, 121 insertions, 0 deletions
diff --git a/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch b/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch
new file mode 100644
index 000000000000..ea7a480abace
--- /dev/null
+++ b/dev-python/twisted/files/twisted-17.9.0-Fix-test-on-Python-363.patch
@@ -0,0 +1,74 @@
+From e58956fe12af7b41f6c1735ba7b14cba69e82a5e Mon Sep 17 00:00:00 2001
+From: Craig Rodrigues <rodrigc@FreeBSD.org>
+Date: Fri, 6 Oct 2017 02:47:55 -0700
+Subject: [PATCH] Fix test on Python 3.6.3
+
+---
+ src/twisted/test/test_sslverify.py | 53 +++++++++++++++++++++++++++++------------------------
+ 1 file changed, 29 insertions(+), 24 deletions(-)
+
+diff --git a/src/twisted/test/test_sslverify.py b/src/twisted/test/test_sslverify.py
+index aca56f5..3fdc480 100644
+--- a/src/twisted/test/test_sslverify.py
++++ b/src/twisted/test/test_sslverify.py
+@@ -3052,28 +3052,33 @@ class SelectVerifyImplementationTests(unittest.SynchronousTestCase):
+ in self.flushWarnings()
+ if warning["category"] == UserWarning)
+
+- if _PY3:
+- importError = (
+- "'import of 'service_identity' halted; None in sys.modules'")
+- else:
+- importError = "'No module named service_identity'"
+-
+- expectedMessage = (
+- "You do not have a working installation of the "
+- "service_identity module: {message}. Please install it from "
+- "<https://pypi.python.org/pypi/service_identity> "
+- "and make sure all of its dependencies are satisfied. "
+- "Without the service_identity module, Twisted can perform only "
+- "rudimentary TLS client hostname verification. Many valid "
+- "certificate/hostname mappings may be rejected.").format(
+- message=importError)
++ importErrors =[
++ # Python 3.6.3
++ "'import of service_identity halted; None in sys.modules'",
++ # Python 3
++ "'import of 'service_identity' halted; None in sys.modules'",
++ # Python 2
++ "'No module named service_identity'"
++ ]
+
+- self.assertEqual(
+- (warning["message"], warning["filename"], warning["lineno"]),
+-
+- # Make sure we're abusing the warning system to a sufficient
+- # degree: there is no filename or line number that makes sense for
+- # this warning to "blame" for the problem. It is a system
+- # misconfiguration. So the location information should be blank
+- # (or as blank as we can make it).
+- (expectedMessage, "", 0))
++ expectedMessages = []
++ for importError in importErrors:
++ expectedMessages.append(
++ "You do not have a working installation of the "
++ "service_identity module: {message}. Please install it from "
++ "<https://pypi.python.org/pypi/service_identity> "
++ "and make sure all of its dependencies are satisfied. "
++ "Without the service_identity module, Twisted can perform only"
++ " rudimentary TLS client hostname verification. Many valid "
++ "certificate/hostname mappings may be rejected.".format(
++ message=importError))
++
++ self.assertIn(warning["message"], expectedMessages)
++
++ # Make sure we're abusing the warning system to a sufficient
++ # degree: there is no filename or line number that makes sense for
++ # this warning to "blame" for the problem. It is a system
++ # misconfiguration. So the location information should be blank
++ # (or as blank as we can make it).
++ self.assertEqual(warning["filename"], "")
++ self.assertEqual(warning["lineno"], 0)
+--
+libgit2 0.26.0
+
diff --git a/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch b/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch
new file mode 100644
index 000000000000..7e3ec26bcfdb
--- /dev/null
+++ b/dev-python/twisted/files/twisted-17.9.0-python-27-utf-8-fix.patch
@@ -0,0 +1,47 @@
+From c7db4c055e92509e5c19a051cbebea53034994ba Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <bdolbec@gaikai.com>
+Date: Wed, 25 Oct 2017 14:39:57 -0700
+Subject: [PATCH] python-2.7 utf-8 fixes
+
+---
+ src/twisted/test/test_twistd.py | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/src/twisted/test/test_twistd.py b/src/twisted/test/test_twistd.py
+index 3a9d337..4b0cf28 100644
+--- a/src/twisted/test/test_twistd.py
++++ b/src/twisted/test/test_twistd.py
+@@ -1902,8 +1902,12 @@ class DaemonizeTests(unittest.TestCase):
+ message is Unicode, the child encodes the message as ascii
+ with backslash Unicode code points.
+ """
++ if sys.hexversion >= 0x3000000:
++ reported_str = b'\u2022'
++ else:
++ reported_str = b'\xe2\x80\xa2'
+ self.assertErrorWritten(raised=u"\u2022",
+- reported=b'1 RuntimeError: \\u2022')
++ reported=b'1 RuntimeError: ' + reported_str)
+
+
+
+@@ -2003,9 +2007,15 @@ class DaemonizeTests(unittest.TestCase):
+ unicode and too long, it's truncated by the child, even if
+ this splits a unicode escape sequence.
+ """
++ if sys.hexversion >= 0x3000000:
++ reported_str = b'\\u2022'
++ length = 14
++ else:
++ reported_str = b'\xe2\x80\xa2'
++ length = 28
+ self.assertErrorWritten(
+ raised=u"\u2022" * 30,
+- reported=b'1 RuntimeError: ' + b'\\u2022' * 14,
++ reported=b'1 RuntimeError: ' + reported_str * length,
+ )
+
+
+--
+libgit2 0.26.0
+