Opened 17 years ago

Closed 17 years ago

#3558 closed (fixed)

rev 4558 breaks in Python 2.3

Reported by: xian@… Owned by: Adrian Holovaty
Component: Template system Version: dev
Severity: Keywords: template filters
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

rev 4558 breaks in Python 2.3 because it tries to write to name which wasn't writable until 2.4. This is a similar problem to what was this one which showed up in 3461
http://groups.google.com/group/django-users/browse_frm/thread/5b4e6727ed2c69ce/73e5ab44c5f08da0%2373e5ab44c5f08da0

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/servers/basehttp.py", line 272, in run
    self.result = application(self.environ, self.start_response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/servers/basehttp.py", line 614, in __call__
    return self.application(environ, start_response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/handlers/wsgi.py", line 184, in __call__
    self.load_middleware()
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/handlers/base.py", line 29, in load_middleware
    mod = __import__(mw_module, {}, {}, [''])
  File "/Users/xian/Sites/malibu/malibu/../malibu/pages/middleware.py", line 1, in ?
    from malibu.pages.views import show_page
  File "/Users/xian/Sites/malibu/malibu/../malibu/pages/views.py", line 1, in ?
    from django.shortcuts import render_to_response, get_object_or_404
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/shortcuts/__init__.py", line 5, in ?
    from django.template import loader
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/template/__init__.py", line 915, in ?
    add_to_builtins('django.template.defaultfilters')
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/template/__init__.py", line 912, in add_to_builtins
    builtins.append(get_library(module_name))
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/template/__init__.py", line 901, in get_library
    mod = __import__(module_name, {}, {}, [''])
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/template/defaultfilters.py", line 55, in ?
    addslashes = stringfilter(addslashes)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/template/defaultfilters.py", line 40, in stringfilter
    _dec.__name__ = func.__name__
TypeError: readonly attribute

I haven't had time to look into fixing this or whip up a patch, but I'm guessing whatever fixed the 3461 will work here as well.

Change History (1)

comment:1 by Jacob, 17 years ago

Resolution: fixed
Status: newclosed

(In [4562]) Fixed #3558: [4558] broken in Python 2.3; this fixes that breakage. Thanks for the heads-up, xian@…

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