10000 [3.11] gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-9… · python/cpython@2c39d00 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c39d00

Browse files
[3.11] gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825) (GH-115602)
Since 2f3941d this function returns the response string, rather than nothing. (cherry picked from commit e88ebc1) Co-authored-by: Matthew Hughes <34972397+matthewhughes934@users.noreply.github.com>
1 parent ba2f2ca commit 2c39d00

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Doc/library/ftplib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ FTP objects
232232
.. method:: FTP.voidcmd(cmd)
233233

234234
Send a simple command string to the server and handle the response. Return
235-
nothing if a response code corresponding to success (codes in the range
236-
200--299) is received. Raise :exc:`error_reply` otherwise.
235+
the response string if the response code corresponds to success (codes in
236+
the range 200--299). Raise :exc:`error_reply` otherwise.
237237

238238
.. audit-event:: ftplib.sendcmd self,cmd ftplib.FTP.voidcmd
239239

Lib/test/test_ftplib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ def test_set_pasv(self):
544544
self.assertFalse(self.client.passiveserver)
545545

546546
def test_voidcmd(self):
547-
self.client.voidcmd('echo 200')
548-
self.client.voidcmd('echo 299')
547+
self.assertEqual(self.client.voidcmd('echo 200'), '200')
548+
self.assertEqual(self.client.voidcmd('echo 299'), '299')
549549
self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 199')
550550
self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 300')
551551

0 commit comments

Comments
 (0)
0