Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
with
1 parent 8e7bb99 commit 5d326abCopy full SHA for 5d326ab
1 file changed
Doc/library/ftplib.rst
@@ -33,7 +33,8 @@ Here's a sample session using the :mod:`ftplib` module::
33
drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project
34
drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools
35
'226 Directory send OK.'
36
- >>> ftp.retrbinary('RETR README', open('README', 'wb').write)
+ >>> with open('README', 'wb') as fp:
37
+ >>> ftp.retrbinary('RETR README', fp.write)
38
'226 Transfer complete.'
39
>>> ftp.quit()
40
0 commit comments