Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#14406 closed (fixed)

Logging doesn't work under Python 2.4

Reported by: Russell Keith-Magee Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


As reported by Łukasz Rekucki on django-dev:

I'm getting a whole bunch of errors related to logging on Python 2.4::

ERROR: Missing templates are correctly reported by test client
Traceback (most recent call last):
 File "/home/lrekucki/projekty/django/django_trunk/tests/regressiontests/test_client_regress/",
line 583, in test_no_404_template
   response = self.client.get("/no_such_view/")
 File "/home/lrekucki/projekty/django/django_trunk/django/test/",
line 298, in get
   response = self.request(**r)
 File "/home/lrekucki/projekty/django/django_trunk/django/test/",
line 238, in request
   response = self.handler(environ)
 File "/home/lrekucki/projekty/django/django_trunk/django/test/",
line 79, in __call__
   response = self.get_response(request)
 File "/home/lrekucki/projekty/django/django_trunk/django/core/handlers/",
line 139, in get_response
   return self.handle_uncaught_exception(request, resolver, sys.exc_info())
 File "/home/lrekucki/projekty/django/django_trunk/django/core/handlers/",
line 182, in handle_uncaught_exception
 File "/home/lrekucki/python/plain2.4//lib/python2.4/logging/",
line 999, in error
   apply(self._log, (ERROR, msg, args), kwargs)
TypeError: _log() got an unexpected keyword argument 'extra'

This is because the 'extra' argument to logging calls didn't existing until Python 2.5.

Attachments (1)

t14406.diff (7.8 KB) - added by Russell Keith-Magee 13 years ago.
Possible fix for Python 2.4 logging.

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by Russell Keith-Magee

Attachment: t14406.diff added

Possible fix for Python 2.4 logging.

comment:1 Changed 13 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 13 years ago by Luke Plant

Triage Stage: AcceptedReady for checkin

I've run the test suite with Python 2.4 and this works fine.

comment:3 Changed 13 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13989]) Fixed #14406 -- Added a Python 2.4 compatibility to the logging interface. Thanks to Łukasz Rekucki for the report, and to Luke Plant for original patch this was based on.

comment:4 Changed 12 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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