Skip to content
Snippets Groups Projects
Commit c99cd3c5f038 authored by Victor Stinner's avatar Victor Stinner
Browse files

Close #6822: ftplib.FTP.storlines() expects a binary file, not a text file

Add an unit test to ensure that text files are rejectect (with TypeError)
parent ad96175825fe
No related branches found
No related tags found
No related merge requests found
......@@ -588,6 +588,10 @@
self.client.storlines('stor foo', f, callback=lambda x: flag.append(None))
self.assertTrue(flag)
f = io.StringIO(RETR_DATA.replace('\r\n', '\n'))
# storlines() expects a binary file, not a text file
self.assertRaises(TypeError, self.client.storlines, 'stor foo', f)
def test_nlst(self):
self.client.nlst()
self.assertEqual(self.client.nlst(), NLST_DATA.split('\r\n')[:-1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment