From 7bed4628fd32fb164d83ac5a4873af8aaa33e7eb Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 12 Mar 2017 17:48:31 -0700 Subject: [PATCH] retrbinary callback gets a bytes, not a str This helps clarify that the callback to retrbinary gets bytes and the callback to retrlines gets str. See the tests at https://github.com/python/cpython/blob/master/Lib/test/test_ftplib.py#L558 to confirm the types that are passed to these callbacks. --- Doc/library/ftplib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst index b8c1dcfef2d98e..335cbe8e34e4f4 100644 --- a/Doc/library/ftplib.rst +++ b/Doc/library/ftplib.rst @@ -235,7 +235,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version. Retrieve a file in binary transfer mode. *cmd* should be an appropriate ``RETR`` command: ``'RETR filename'``. The *callback* function is called for - each block of data received, with a single string argument giving the data + each block of data received, with a single bytes argument giving the data block. The optional *blocksize* argument specifies the maximum chunk size to read on the low-level socket object created to do the actual transfer (which will also be the largest size of the data blocks passed to *callback*). A