Opened 3 years ago

Closed 3 years ago

#17873 closed Bug (fixed)

django.utils.translation.get_date_formats raises exception

Reported by: Glenn Washburn <development@…> Owned by: nobody
Component: Translations Version: 1.4-beta-1
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by aaugustin)

Because django.utils.translation.get_date_formats just proxies to either the null or real translation functions, those functions sets must have get_date_formats as a member. Neither have it.

>>> from django.utils.translation import ugettext, get_date_formats
>>> get_date_formats()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/virtenv/src/django/django/utils/translation/__init__.py", line 136, in get_date_formats
    return _trans.get_date_formats()
  File "/virtenv/src/django/django/utils/translation/__init__.py", line 67, in __getattr__
    setattr(self, real_name, getattr(trans, real_name))
AttributeError: 'module' object has no attribute 'get_date_formats'

Attachments (1)

17873.diff (920 bytes) - added by aaugustin 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 3 years ago by aaugustin

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Fixed formatting -- please use "Preview".

comment:2 Changed 3 years ago by aaugustin

  • Has patch set
  • Severity changed from Normal to Release blocker
  • Triage Stage changed from Unreviewed to Accepted

The same problem exists with get_partial_date_formats.

These functions are removed in 1.4 -- see the deprecation timeline -- but the references in __init__ were missed in r15987.

Patch attached.

Changed 3 years ago by aaugustin

comment:3 Changed 3 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 3 years ago by jezdez

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

In [17684]:

Fixed #17873 -- Removed stale code from translation utilities that should have been removed a while ago. Thanks, Aymeric Augustin.

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