Modify ↓
Opened 10 years ago
Last modified 8 years ago
#12133 new defect
WikiCalendarMacros uses undefined function format_datetime if babel library is not importable
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Component: | WikiCalendarMacro |
Severity: | normal | Keywords: | patch |
Cc: | Trac Release: |
Description
There is some fallback code in source:wikicalendarmacro/trunk/wikicalendar/macros.py@13798
has_babel = True try: from babel import Locale, UnknownLocaleError from babel.core import LOCALE_ALIASES from babel.dates import format_datetime, get_day_names except ImportError: has_babel = False def get_day_names(*args): """Cheap replacement for the identically named Babel function.""" names = dict() for day in range(0, 7): dt = datetime(2001, 1, day + 1) names[day] = dt.strftime('%a')[:2] return names
but this is incomplete, as no alternative for format_datetime()
is provided, and format_datetime()
is called in the implementation.
I'll attach a patch which shows how we resolved this for our own project.
Attachments (1)
Change History (3)
Changed 10 years ago by
Attachment: | changeset_24890.diff added |
---|
comment:2 Changed 8 years ago by
Owner: | Steffen Hoffmann deleted |
---|
Note: See
TracTickets for help on using
tickets.
Candidate patch for #12133, against revision 13798