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

Description

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/models.py",
line 583, in test_no_404_template
   response = self.client.get("/no_such_view/")
 File "/home/lrekucki/projekty/django/django_trunk/django/test/client.py",
line 298, in get
   response = self.request(**r)
 File "/home/lrekucki/projekty/django/django_trunk/django/test/client.py",
line 238, in request
   response = self.handler(environ)
 File "/home/lrekucki/projekty/django/django_trunk/django/test/client.py",
line 79, in __call__
   response = self.get_response(request)
 File "/home/lrekucki/projekty/django/django_trunk/django/core/handlers/base.py",
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/base.py",
line 182, in handle_uncaught_exception
   extra={
 File "/home/lrekucki/python/plain2.4//lib/python2.4/logging/__init__.py",
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)

by Russell Keith-Magee, 13 years ago

Attachment: t14406.diff added

Possible fix for Python 2.4 logging.

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

Triage Stage: UnreviewedAccepted

comment:2 by Luke Plant, 13 years ago

Triage Stage: AcceptedReady for checkin

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

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

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 by Jacob, 12 years ago

milestone: 1.3

Milestone 1.3 deleted

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