This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: wave module readframes now returns bytes not str
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Iber Parodi Siri, SilentGhost, docs@python, martin.panter, python-dev, r.david.murray, serhiy.storchaka
Priority: normal Keywords: needs review, patch

Created on 2015-12-20 10:31 by Iber Parodi Siri, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
issue25916.diff SilentGhost, 2015-12-20 10:43 review
issue25916_2.diff SilentGhost, 2015-12-20 16:44 review
issue25916_3.diff SilentGhost, 2016-01-01 20:44 review
issue25916_4.diff SilentGhost, 2016-01-01 20:52 review
Messages (14)
msg256759 - (view) Author: Iber Parodi Siri (Iber Parodi Siri) Date: 2015-12-20 10:31
The documentation of readframes (wave module) states that readframes returns a string of bytes, just like python 2.7, but that's not the case

in python 3.4 readframes returns byte type objects
msg256760 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-12-20 10:43
Here is the patch.
msg256772 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-12-20 16:35
This is not the only place where "string of bytes" or "byte string" is used as a synonym to "bytes object".
msg256773 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-12-20 16:38
Yes, and I think it would be good to consistently use "bytes object" or similar wording, to avoid confusion.  But not high enough priority to do a hunt-and-fix (unless someone really feels like doing that).  I've got a patch pending for fixing it in the base64 module, as part of making other fixes to that doc, for example.
msg256774 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-12-20 16:44
Here is the patch replacing exact match 'string of bytes' with :class:`bytes` where appropriate. No match was found in base64.
msg257261 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-01 02:00
Two of the changes don’t seem right to me; see the review. In the other two cases, IMO “string of bytes” is a reasonable description of :class:`bytes`, but being explicit is better.
msg257292 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-01-01 20:13
Agree with Martin.  Only the two audio module changes are correct.  However, I think we can reduce ambiguity without compromising the meaning by changing "string of bytes" to "sequence of bytes" in both of those other cases.
msg257297 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-01-01 20:44
Here is the updated patch.
msg257298 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-01-01 20:47
In those contexts, bytes should not be linked to the bytes object.
msg257302 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-01 21:24
Patch 4 looks fine to me.
msg257306 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-01-01 21:30
Another uses of this idiom:

"string of 16 bytes" in uuid.rst and
"string of *n* random bytes" in os.rst
"string of bytes" in bytesio.c

And a number of uses "bytestring", "byte string" and "bytes string". I think that either all occurrences should be changed consistently, or nothing. Personally I'm good with all these "string of bytes", "bytestring", etc, it is clear to me that that mean bytes or bytes-like objects. What is a bug, it's using the term "string" without "bytes" for bytes strings (there are a lot of such Python 2 remnants in the documentation and comments).
msg257307 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-01-01 21:36
As I said, I think it's like fixing style issues in code: only do it if you touch the docs for some other reason.  But this patch is fine.  Although we should fix the 'string' when it is really 'bytes' issues, if we can find them.  Those are real bugs, not style issues.  But that should be a different issue or issues from this one.
msg273524 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-08-24 00:44
New changeset 7ac8e8568da2 by R David Murray in branch '3.5':
#25916: fix a few 'string of bytes' references.

New changeset 089f7d761a9c by R David Murray in branch 'default':
Merge: #25916: fix a few 'string of bytes' references.
msg273525 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-08-24 00:45
Thanks SilentGhost.
Date User Action Args
2022-04-11 14:58:25adminsetgithub: 70104
2016-08-24 00:45:39r.david.murraysetstatus: open -> closed
resolution: fixed
messages: + msg273525

stage: commit review -> resolved
2016-08-24 00:44:52python-devsetnosy: + python-dev
messages: + msg273524
2016-01-01 21:36:15r.david.murraysetmessages: + msg257307
2016-01-01 21:30:54serhiy.storchakasetmessages: + msg257306
2016-01-01 21:24:18martin.pantersetmessages: + msg257302
2016-01-01 20:52:42SilentGhostsetfiles: + issue25916_4.diff
2016-01-01 20:47:27r.david.murraysetmessages: + msg257298
2016-01-01 20:44:51SilentGhostsetfiles: + issue25916_3.diff

messages: + msg257297
2016-01-01 20:13:25r.david.murraysetmessages: + msg257292
2016-01-01 02:00:47martin.pantersetnosy: + martin.panter
messages: + msg257261
2015-12-20 16:44:42SilentGhostsetfiles: + issue25916_2.diff

messages: + msg256774
2015-12-20 16:38:06r.david.murraysetnosy: + r.david.murray
messages: + msg256773
2015-12-20 16:35:52serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg256772
2015-12-20 16:33:45r.david.murraysetversions: - Python 3.3, Python 3.4
2015-12-20 16:33:21r.david.murraysetstage: patch review -> commit review
2015-12-20 10:43:57SilentGhostsetfiles: + issue25916.diff

type: behavior
versions: + Python 3.3, Python 3.5, Python 3.6
keywords: + needs review, patch
nosy: + SilentGhost

messages: + msg256760
stage: patch review
2015-12-20 10:31:11Iber Parodi Siricreate