Opened 16 years ago

Closed 16 years ago

#5960 closed (fixed)

AutoEscaping change breaks python 2.3.5 compatability due to use of decode function on unicode objects

Reported by: Free Neuron <freeneuron+django@…> Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords: decode, unicode, escape
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

http://code.djangoproject.com/browser/django/trunk/django/utils/safestring.py?rev=6671

File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/utils/safestring.py", line 92, in SafeUnicode

decode = curry(_proxy_method, method = unicode.decode)

AttributeError: type object 'unicode' has no attribute 'decode'

Under python 2.3.5 u"a".decode("rot13") throws, under 2.4 it succeeds.

Change History (6)

comment:1 by Free Neuron <freeneuron+django@…>, 16 years ago

Python 2.3.5 (#1, Aug 19 2006, 21:31:42)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

u"asdf".decode("rot13")

Traceback (most recent call last):

File "<stdin>", line 1, in ?

AttributeError: 'unicode' object has no attribute 'decode'

in reply to:  description comment:2 by anonymous, 16 years ago

Confirmed same behavior, SVN, RHEL 4, Python 2.3.4
Fixed by reverting to 0.96.1

comment:3 by Malcolm Tredinnick, 16 years ago

What do I have to do to trigger this problem in Django? It's not immediately clear how we're getting to that code path, so a short example of how to repeat the bug is necessary.

comment:4 by Malcolm Tredinnick, 16 years ago

Triage Stage: UnreviewedAccepted

comment:5 by Malcolm Tredinnick, 16 years ago

Ignore comment 3. I worked it out (things fail just trying to start up when you run the tests).

comment:6 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [6685]) Fixed #5960 -- Fixed some Python 2.3 incompatibilities.

Note: See TracTickets for help on using tickets.
Back to Top