Index: Doc/library/ftplib.rst =================================================================== --- Doc/library/ftplib.rst (révision 84329) +++ Doc/library/ftplib.rst (copie de travail) @@ -260,7 +260,7 @@ Store a file in ASCII transfer mode. *cmd* should be an appropriate ``STOR`` command (see :meth:`storbinary`). Lines are read until EOF from the - open file object *file* using its :meth:`readline` method to provide the data to + open binary file object *file* using its :meth:`readline` method to provide the data to be stored. *callback* is an optional single parameter callable that is called on each line after it is sent. Index: Lib/test/test_ftplib.py =================================================================== --- Lib/test/test_ftplib.py (révision 84329) +++ Lib/test/test_ftplib.py (copie de travail) @@ -540,6 +540,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])