classification
Title: Outdated usage str.encode('rot-13') in rot13 codec
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.5, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Pix, benjamin.peterson, berker.peksag, eric.araujo, ezio.melotti, haypo, lemburg, ncoghlan, pitrou, python-dev, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2014-04-07 16:25 by Pix, last changed 2014-04-17 03:33 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
issue21171.diff berker.peksag, 2014-04-08 05:07 review
Messages (5)
msg215712 - (view) Author: Михаил Мишакин (Pix) Date: 2014-04-07 16:25
Function rot13 in file "encodings/rot_13.py" throws exception:

LookupError: 'rot-13' is not a text encoding; use codecs.encode() to handle arbitrary codecs
msg215733 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-04-08 05:07
Here's a patch. I tested it with the following command:

    $ cat LICENSE | ./python -m encodings.rot_13
msg215944 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-04-11 18:38
Since rot_13 is a transcoder, not an encoder, the error message is correct, as is the fix for the function. However, since neither the module encodings.rot_13 nor the rot13 function in the module are documented, (not even in 2.7), I wonder if the function and the if __name__; clause are ancient holdovers that should be removed. In other words, I am not sure if Berker's test is currently a supported usage. I remember that there was some discussion on pydev about how much to add back but not the details.
msg216005 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-04-13 09:10
LGTM.
msg216017 - (view) Author: Roundup Robot (python-dev) Date: 2014-04-13 14:09
New changeset a81f0caab279 by Serhiy Storchaka in branch '3.4':
Issue #21171: Fixed undocumented filter API of the rot13 codec.
http://hg.python.org/cpython/rev/a81f0caab279

New changeset f86504da2fcc by Serhiy Storchaka in branch 'default':
Issue #21171: Fixed undocumented filter API of the rot13 codec.
http://hg.python.org/cpython/rev/f86504da2fcc
History
Date User Action Args
2014-04-17 03:33:28benjamin.petersonsetstatus: open -> closed
resolution: fixed
2014-04-13 14:09:05python-devsetnosy: + python-dev
messages: + msg216017
2014-04-13 09:10:04serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg216005
2014-04-12 06:24:52eric.araujosetnosy: + eric.araujo
2014-04-12 03:29:45hayposetnosy: + ncoghlan
2014-04-11 18:38:07terry.reedysetnosy: + ezio.melotti, haypo, benjamin.peterson, pitrou, terry.reedy
messages: + msg215944
2014-04-08 05:07:29berker.peksagsetfiles: + issue21171.diff

type: enhancement -> behavior

keywords: + patch
nosy: + berker.peksag
messages: + msg215733
stage: patch review
2014-04-08 05:00:03berker.peksagsetnosy: + lemburg
2014-04-07 16:27:14Pixsetcomponents: + Library (Lib)
2014-04-07 16:25:51Pixcreate