You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect documentation for zipfile.writestr() #71498
Activity
johnthagen commentedon Jun 14, 2016
The function signature and description for zipfile.writestr is incorrect:
https://docs.python.org/3.5/library/zipfile.html#zipfile.ZipFile.writestr
See:
https://github.com/python/cpython/blob/master/Lib/zipfile.py#L1610
The documentation calls the parameter 'bytes', but the real parameter name is 'data'.
Looks like this was not fixed when the source changed to Python 3:
https://github.com/python/cpython/blob/2.7/Lib/zipfile.py#L1208
vadmium commentedon Jun 14, 2016
Looks like you are right. The change in the implementation happened in revision 19196cce1431.
johnthagen commentedon Jun 14, 2016
I'll submit a patch shortly.
johnthagen commentedon Jun 14, 2016
Patch attached.
vadmium commentedon Jun 14, 2016
Thanks John
python-dev commentedon Jun 15, 2016
New changeset 32af78a8b88f by Martin Panter in branch '3.5':
Issue bpo-27311: Fix ZipFile.writestr data argument name.
https://hg.python.org/cpython/rev/32af78a8b88f
New changeset e3bb87952c62 by Martin Panter in branch 'default':
Issue bpo-27311: Merge zipfile doc from 3.5
https://hg.python.org/cpython/rev/e3bb87952c62