Opened 5 years ago

Closed 5 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 Aymeric Augustin)

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 Aymeric Augustin 5 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 5 years ago by Aymeric Augustin

Description: modified (diff)

Fixed formatting -- please use "Preview".

comment:2 Changed 5 years ago by Aymeric Augustin

Has patch: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

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 5 years ago by Aymeric Augustin

Attachment: 17873.diff added

comment:3 Changed 5 years ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

comment:4 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

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