summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python/0001-bpo-33354-Fix-test_ssl-when-a-filename-cannot-be-enc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python/0001-bpo-33354-Fix-test_ssl-when-a-filename-cannot-be-enc.patch')
-rw-r--r--meta/recipes-devtools/python/python/0001-bpo-33354-Fix-test_ssl-when-a-filename-cannot-be-enc.patch55
1 files changed, 0 insertions, 55 deletions
diff --git a/meta/recipes-devtools/python/python/0001-bpo-33354-Fix-test_ssl-when-a-filename-cannot-be-enc.patch b/meta/recipes-devtools/python/python/0001-bpo-33354-Fix-test_ssl-when-a-filename-cannot-be-enc.patch
deleted file mode 100644
index 4c0b3577b2..0000000000
--- a/meta/recipes-devtools/python/python/0001-bpo-33354-Fix-test_ssl-when-a-filename-cannot-be-enc.patch
+++ /dev/null
@@ -1,55 +0,0 @@
1From 19f6bd06af3c7fc0db5f96878aaa68f5589ff13e Mon Sep 17 00:00:00 2001
2From: Pablo Galindo <Pablogsal@gmail.com>
3Date: Thu, 24 May 2018 23:20:44 +0100
4Subject: [PATCH] bpo-33354: Fix test_ssl when a filename cannot be encoded
5 (GH-6613)
6
7Skip test_load_dh_params() of test_ssl when Python filesystem encoding
8cannot encode the provided path.
9
10Upstream-Status: Backport [https://github.com/python/cpython/commit/19f6bd06af3c7fc0db5f96878aaa68f5589ff13e]
11Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
12---
13 Lib/test/test_ssl.py | 9 ++++++++-
14 .../next/Tests/2018-04-26-22-39-17.bpo-33354.g35-44.rst | 2 ++
15 2 files changed, 10 insertions(+), 1 deletion(-)
16 create mode 100644 Misc/NEWS.d/next/Tests/2018-04-26-22-39-17.bpo-33354.g35-44.rst
17
18diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
19index b59fe73f04..7ced90fdf6 100644
20--- a/Lib/test/test_ssl.py
21+++ b/Lib/test/test_ssl.py
22@@ -989,6 +989,13 @@ class ContextTests(unittest.TestCase):
23
24
25 def test_load_dh_params(self):
26+ filename = u'dhpäräm.pem'
27+ fs_encoding = sys.getfilesystemencoding()
28+ try:
29+ filename.encode(fs_encoding)
30+ except UnicodeEncodeError:
31+ self.skipTest("filename %r cannot be encoded to the filesystem encoding %r" % (filename, fs_encoding))
32+
33 ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
34 ctx.load_dh_params(DHFILE)
35 if os.name != 'nt':
36@@ -1001,7 +1008,7 @@ class ContextTests(unittest.TestCase):
37 with self.assertRaises(ssl.SSLError) as cm:
38 ctx.load_dh_params(CERTFILE)
39 with support.temp_dir() as d:
40- fname = os.path.join(d, u'dhpäräm.pem')
41+ fname = os.path.join(d, filename)
42 shutil.copy(DHFILE, fname)
43 ctx.load_dh_params(fname)
44
45diff --git a/Misc/NEWS.d/next/Tests/2018-04-26-22-39-17.bpo-33354.g35-44.rst b/Misc/NEWS.d/next/Tests/2018-04-26-22-39-17.bpo-33354.g35-44.rst
46new file mode 100644
47index 0000000000..c66cecac32
48--- /dev/null
49+++ b/Misc/NEWS.d/next/Tests/2018-04-26-22-39-17.bpo-33354.g35-44.rst
50@@ -0,0 +1,2 @@
51+Skip ``test_ssl.test_load_dh_params`` when Python filesystem encoding cannot encode the
52+provided path.
53--
542.17.1
55