Opened 8 years ago

Closed 8 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: master
Severity: Keywords: decode, unicode, escape
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 8 years ago by Free Neuron <freeneuron+django@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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'

comment:2 in reply to: ↑ description Changed 8 years ago by anonymous

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

comment:3 Changed 8 years ago by mtredinnick

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 Changed 8 years ago by mtredinnick

  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 8 years ago by mtredinnick

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

comment:6 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

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