[ python-Bugs-1465619 ] str.decode('rot13') produces Unicode

SourceForge.net noreply at sourceforge.net
Thu Apr 6 13:25:57 CEST 2006


Bugs item #1465619, was opened at 2006-04-06 10:05
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1465619&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Kent Johnson (kjohnson)
Assigned to: Walter Dörwald (doerwalter)
Summary: str.decode('rot13') produces Unicode

Initial Comment:
In 3.8.3 Standard Encodings, the table at the bottom
listing special encodings says that the result of
str.decode('rot13') is a byte string. In Python 2.4.3
it is actually a Unicode string so this table entry
should be changed.

In [40]: 'abc'.decode('rot13')
Out[40]: u'nop'

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-04-06 11:25

Message:
Logged In: YES 
user_id=849994

Okay. Fixed docs in rev. 43701, 43702.

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2006-04-06 11:18

Message:
Logged In: YES 
user_id=38388

rot 13 returns Unicode because it uses the charmap codec
which works this way.

I don't see much of a reason to change this.

The documentation will have to be updated, though.

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2006-04-06 10:59

Message:
Logged In: YES 
user_id=849994

Walter: Wouldn't make it sense for rot13 to actually output
byte strings?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1465619&group_id=5470


More information about the Python-bugs-list mailing list