summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3')
-rw-r--r--meta/recipes-devtools/python/python3/ftplib.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/ftplib.patch b/meta/recipes-devtools/python/python3/ftplib.patch
new file mode 100644
index 0000000000..8bb3cd0219
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/ftplib.patch
@@ -0,0 +1,57 @@
1From cabe916dc694997d4892b58986e73a713d5a2f8d Mon Sep 17 00:00:00 2001
2From: "Miss Islington (bot)"
3 <31488909+miss-islington@users.noreply.github.com>
4Date: Thu, 16 Aug 2018 15:38:03 -0400
5Subject: [PATCH] [3.6] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787)
6 (#8790)
7
8Read from data socket to avoid "[SSL] shutdown while in init" exception
9during shutdown of the dummy server.
10
11Signed-off-by: Christian Heimes <christian@python.org>
12
13
14<!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) -->
15https://bugs.python.org/issue34391
16<!-- /issue-number -->
17(cherry picked from commit 1590c393360df059160145e7475754427bfc6680)
18
19
20Co-authored-by: Christian Heimes <christian@python.org>
21---
22 Lib/test/test_ftplib.py | 5 +++++
23 Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst | 1 +
24 2 files changed, 6 insertions(+)
25 create mode 100644 Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst
26
27diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
28index 44dd73aeca..4ff2f71afb 100644
29--- a/Lib/test/test_ftplib.py
30+++ b/Lib/test/test_ftplib.py
31@@ -876,18 +876,23 @@ class TestTLS_FTPClass(TestCase):
32 # clear text
33 with self.client.transfercmd('list') as sock:
34 self.assertNotIsInstance(sock, ssl.SSLSocket)
35+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
36 self.assertEqual(self.client.voidresp(), "226 transfer complete")
37
38 # secured, after PROT P
39 self.client.prot_p()
40 with self.client.transfercmd('list') as sock:
41 self.assertIsInstance(sock, ssl.SSLSocket)
42+ # consume from SSL socket to finalize handshake and avoid
43+ # "SSLError [SSL] shutdown while in init"
44+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
45 self.assertEqual(self.client.voidresp(), "226 transfer complete")
46
47 # PROT C is issued, the connection must be in cleartext again
48 self.client.prot_c()
49 with self.client.transfercmd('list') as sock:
50 self.assertNotIsInstance(sock, ssl.SSLSocket)
51+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
52 self.assertEqual(self.client.voidresp(), "226 transfer complete")
53
54 def test_login(self):
55--
562.11.0
57