Skip to content

Commit

Permalink
Doc: Use the with statement in the first example of the ftplib doc. (
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixise authored Sep 26, 2019
1 parent 8e7bb99 commit 5d326ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/library/ftplib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Here's a sample session using the :mod:`ftplib` module::
drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project
drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools
'226 Directory send OK.'
>>> ftp.retrbinary('RETR README', open('README', 'wb').write)
>>> with open('README', 'wb') as fp:
>>> ftp.retrbinary('RETR README', fp.write)
'226 Transfer complete.'
>>> ftp.quit()

Expand Down

0 comments on commit 5d326ab

Please sign in to comment.