https://github.com/python/cpython/commit/2c39d00a56209dd1f34bfaf9688e9ab560cd3281 commit: 2c39d00a56209dd1f34bfaf9688e9ab560cd3281 branch: 3.11 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2024-02-17T14:54:31+02:00 summary:
[3.11] gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825) (GH-115602) Since 2f3941d743481ac48628b8b2c075f2b82762050b this function returns the response string, rather than nothing. (cherry picked from commit e88ebc1c4028cf2f0db43659e513440257eaec01) Co-authored-by: Matthew Hughes <[email protected]> files: M Doc/library/ftplib.rst M Lib/test/test_ftplib.py diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst index f5686780213edd..74c7bb63b8fc0a 100644 --- a/Doc/library/ftplib.rst +++ b/Doc/library/ftplib.rst @@ -232,8 +232,8 @@ FTP objects .. method:: FTP.voidcmd(cmd) Send a simple command string to the server and handle the response. Return - nothing if a response code corresponding to success (codes in the range - 200--299) is received. Raise :exc:`error_reply` otherwise. + the response string if the response code corresponds to success (codes in + the range 200--299). Raise :exc:`error_reply` otherwise. .. audit-event:: ftplib.sendcmd self,cmd ftplib.FTP.voidcmd diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index a90a53f278664f..d813ecdcd6fcac 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -544,8 +544,8 @@ def test_set_pasv(self): self.assertFalse(self.client.passiveserver) def test_voidcmd(self): - self.client.voidcmd('echo 200') - self.client.voidcmd('echo 299') + self.assertEqual(self.client.voidcmd('echo 200'), '200') + self.assertEqual(self.client.voidcmd('echo 299'), '299') self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 199') self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 300') _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
