classification
Title: ftplib documentation gives a wrong argument name for storbinary
Type: Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: berker.peksag Nosy List: Derek.Kurth, berker.peksag, docs@python, python-dev
Priority: normal Keywords:

Created on 2014-10-07 20:34 by Derek.Kurth, last changed 2017-03-13 02:35 by xiang.zhang. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 656 merged xiang.zhang, 2017-03-13 02:33
Messages (3)
msg228773 - (view) Author: Derek Kurth (Derek.Kurth) Date: 2014-10-07 20:34
The Python 3 documentation for ftplib gives the storbinary method signature as:

FTP.storbinary(cmd, file, blocksize=8192, callback=None, rest=None)

However, the parameter named "file" is actually named "fp" in the code, so if you do something like this:

ftp.storbinary(cmd="RETR something.txt", file=f)

then you will get a TypeError: storbinary() got an unexpected keyword argument 'file'.  

I think the documentation should be updated to call that argument "fp" instead of "file."
msg228781 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-08 10:15
New changeset 4cc584d47c7d by Berker Peksag in branch '3.4':
Issue #22576: Fix signatures of FTP.storbinary() and FTP.storlines() methods.
https://hg.python.org/cpython/rev/4cc584d47c7d

New changeset f21f0de30544 by Berker Peksag in branch 'default':
Issue #22576: Fix signatures of FTP.storbinary() and FTP.storlines() methods.
https://hg.python.org/cpython/rev/f21f0de30544
msg228782 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-10-08 10:16
Fixed. Thanks for the report, Derek.
History
Date User Action Args
2017-03-13 02:35:06xiang.zhangsetversions: + Python 2.7
2017-03-13 02:33:41xiang.zhangsetpull_requests: + pull_request539
2014-10-08 10:16:52berker.peksagsetstatus: open -> closed

assignee: docs@python -> berker.peksag
versions: + Python 3.4, Python 3.5, - Python 3.3
nosy: + berker.peksag

messages: + msg228782
resolution: fixed
stage: resolved
2014-10-08 10:15:51python-devsetnosy: + python-dev
messages: + msg228781
2014-10-07 20:34:38Derek.Kurthcreate