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.

classification
Title: codecs.encode/decode documentation inconsistency
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Ouaouaron, berker.peksag, brett.cannon, docs@python, ncoghlan, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2014-05-12 23:37 by Ouaouaron, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue21488.diff berker.peksag, 2014-05-13 10:47 review
codecs_decode_encode_kw.patch vstinner, 2014-05-14 09:29 review
Messages (13)
msg218380 - (view) Author: Brad Aylsworth (Ouaouaron) Date: 2014-05-12 23:37
The documentation page for codecs (https://docs.python.org/2/library/codecs.html) shows keyword arguments for codecs.encode and codecs.decode, but they throw an error if keyword arguments are used. codecs.decode.__doc__ reports 'decode(obj, [encoding[,errors]]) -> object.

This happens on both 2.7.6 and 3.4.0.
msg218464 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-05-13 14:48
Berker's patch LGTM, so assigning to him to commit.
msg218506 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2014-05-14 07:08
Brett, if you granted Berker commit privileges, you forgot to update the developer log and issue tracker...

That said, the patch LGTM too.
msg218510 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-05-14 09:19
For Python 3.5, I would prefer to patch the code to support keywords instead.
msg218511 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-05-14 09:21
I sent a review on Rietveld.
msg218512 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-05-14 09:29
codecs_decode_encode_kw.patch: Patch for Python 3.5 adding support of keyword arguments on codecs.encode and codecs.decode.
msg218529 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-05-14 13:41
Nope, I forgot Berker had triage rights but not commit rights.
msg218539 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-14 15:09
New changeset cc5e3b93c35a by Victor Stinner in branch '2.7':
Issue #21488: Fix doc of codecs.decode() and codecs.encode(), no keyword support.
http://hg.python.org/cpython/rev/cc5e3b93c35a

New changeset 2e116176a81f by Victor Stinner in branch '3.4':
Issue #21488: Fix doc of codecs.decode() and codecs.encode(), no keyword support.
http://hg.python.org/cpython/rev/2e116176a81f

New changeset 889896471498 by Victor Stinner in branch 'default':
Merge 3.4: ignore change specific to 3.4 for #21488, I had a different patch for Python 3.5
http://hg.python.org/cpython/rev/889896471498
msg218541 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-14 15:10
New changeset 6ceedbd88b5f by Victor Stinner in branch '3.4':
Issue #21488: Add support of keyword arguments for codecs.encode and codecs.decode
http://hg.python.org/cpython/rev/6ceedbd88b5f
msg218542 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-05-14 15:11
I applied all patches and added Brad Aylsworth to Misc/ACKS. Thanks Brad!

Note: I adapted the change for Python 2.7: the default encoding is ASCII, not UTF-8.
msg218543 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-14 15:13
New changeset 0d38044c0b02 by Victor Stinner in branch 'default':
Issue #21488: Add support of keyword arguments for codecs.encode and codecs.decode
http://hg.python.org/cpython/rev/0d38044c0b02
msg218544 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-05-14 15:14
Ooops, I applied  codecs_decode_encode_kw.patch to the branch 3.4 instead of default :-/ I should now be fixed.
msg218574 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-14 21:37
New changeset 0a6f0aaeb96a by Victor Stinner in branch '2.7':
Issue #21488: Oops, the patch for codecs.encode/decode doc was written by
http://hg.python.org/cpython/rev/0a6f0aaeb96a

New changeset 91dca6b9ef0f by Victor Stinner in branch '3.4':
Issue #21488: Oops, the patch for codecs.encode/decode doc was written by
http://hg.python.org/cpython/rev/91dca6b9ef0f
History
Date User Action Args
2022-04-11 14:58:03adminsetgithub: 65687
2014-05-14 21:37:35python-devsetmessages: + msg218574
2014-05-14 15:17:00berker.peksagsetstage: commit review -> resolved
2014-05-14 15:14:34vstinnersetmessages: + msg218544
2014-05-14 15:13:56python-devsetmessages: + msg218543
2014-05-14 15:11:44vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg218542
2014-05-14 15:10:59python-devsetmessages: + msg218541
2014-05-14 15:09:57python-devsetnosy: + python-dev
messages: + msg218539
2014-05-14 13:41:36brett.cannonsetassignee: berker.peksag -> docs@python
messages: + msg218529
2014-05-14 09:29:13vstinnersetfiles: + codecs_decode_encode_kw.patch

messages: + msg218512
2014-05-14 09:21:57vstinnersetmessages: + msg218511
2014-05-14 09:19:22vstinnersetnosy: + vstinner
messages: + msg218510
2014-05-14 07:08:18ncoghlansetmessages: + msg218506
2014-05-13 14:48:18brett.cannonsetnosy: + brett.cannon
messages: + msg218464

assignee: docs@python -> berker.peksag
stage: patch review -> commit review
2014-05-13 10:47:46berker.peksagsetfiles: + issue21488.diff

nosy: + ncoghlan, berker.peksag
versions: + Python 3.4, Python 3.5
keywords: + patch
type: resource usage -> behavior
stage: patch review
2014-05-12 23:37:30Ouaouaroncreate