Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#14406 closed (fixed)

Logging doesn't work under Python 2.4

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

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 russellm 5 years ago.
Possible fix for Python 2.4 logging.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by russellm

Possible fix for Python 2.4 logging.

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by lukeplant

  • Triage Stage changed from Accepted to Ready for checkin

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

comment:3 Changed 5 years ago by russellm

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

(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 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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