[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-25 Thread miss-islington


miss-islington  added the comment:


New changeset af009fbcdb00fffced653792eb7af6b72f2521e3 by Miss Islington (bot) 
in branch '3.6':
bpo-32035: Fix words about strings and bytes in zipfile documentation. 
(GH-10592)
https://github.com/python/cpython/commit/af009fbcdb00fffced653792eb7af6b72f2521e3


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-25 Thread miss-islington


miss-islington  added the comment:


New changeset 89a3087d40feed3ca78033319389437bb4b5bcd7 by Miss Islington (bot) 
in branch '3.7':
bpo-32035: Fix words about strings and bytes in zipfile documentation. 
(GH-10592)
https://github.com/python/cpython/commit/89a3087d40feed3ca78033319389437bb4b5bcd7


--
nosy: +miss-islington, miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9948

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9947

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4bb186d7e253ad4def875305e06690181e923dfd by Serhiy Storchaka in 
branch 'master':
bpo-32035: Fix words about strings and bytes in zipfile documentation. 
(GH-10592)
https://github.com/python/cpython/commit/4bb186d7e253ad4def875305e06690181e923dfd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since the docstring contains more information, it is better to just copy words 
from the docstring to the documentation.

There are also other places where string is improperly used instead of bytes or 
the type is not specified. The note about file name encoding doesn't make sense 
in Python 3, since ZipFile.write() doesn't support bytes as a file name.

PR 10592 fixed this.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9838

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2018-11-18 Thread Sanyam Khurana


Sanyam Khurana  added the comment:

The change in current PR is very minor and looks good enough that aligns the 
docs with the docstring and functionality of `ZipFile.writestr` as described.

Can a core-contributor, please look at this?

Also, I'm adding 3.8 for this change.

--
nosy: +CuriousLearner
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2017-12-08 Thread Chirag Rathod

Change by Chirag Rathod :


--
pull_requests: +4660

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2017-12-04 Thread Chirag Rathod

Change by Chirag Rathod :


--
keywords: +patch
pull_requests: +4610
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2017-11-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +easy
stage:  -> needs patch
type:  -> enhancement
versions:  -Python 3.4, Python 3.5, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes

2017-11-15 Thread Daniel

New submission from Daniel :

The documentation for "ZipFile.writestr(zinfo_or_arcname, data[, 
compress_type])" says: "Write the string data to the archive; [...]"
--> https://docs.python.org/3/library/zipfile.html

I fails to mention that data could also be bytes.

The source code does mention it however, that is how I found out:

def writestr(self, zinfo_or_arcname, data, compress_type=None):
"""Write a file into the archive.  The contents is 'data', which
may be either a 'str' or a 'bytes' instance; if it is a 'str',
it is encoded as UTF-8 first.
'zinfo_or_arcname' is either a ZipInfo instance or
the name of the file in the archive."""

I believe this should be added to the documentation as it's an important 
information to those who try to add non-UTF8 StringIO data to in-memory 
ZipFiles using BytesIO.

--
assignee: docs@python
components: Documentation
messages: 306271
nosy: Daniel5148, docs@python
priority: normal
severity: normal
status: open
title: Documentation of zipfile.ZipFile().writestr() fails to mention that 
'data' may also be bytes
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com