Modify

Opened 9 years ago

Closed 9 years ago

#3021 closed defect (fixed)

Error at browse by time when locale is ja_JP

Reported by: hirobe Owned by: Odd Simon Simonsen
Priority: normal Component: FullBlogPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Calendar.month_name returns 2bytecode if locale is ja_JP.

Patch is here.

  • util.py

    (this hunk was shorter than expected) 
    1111import calendar
    1212
    1313from trac.util.datefmt import utc
     14from trac.util.text import to_unicode
    1415
    1516def add_months(thedate, months):
    1617    """ Add <months> months to <thedate>. """
    1718    y, m, d = thedate.timetuple()[:3]
     
    2626        return month_list
    2727    else:
    2828        # Use list from default locale setting
    29         return [calendar.month_name[i+1] for i in range(12)]
     29        return [to_unicode(calendar.month_name[i+1]) for i in range(12)]
    3030
    3131def parse_period(items=[]):
    3232    """ Parses a list of items for elements of dates, and returns

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by Odd Simon Simonsen

Resolution: fixed
Status: newclosed

(In [3695]) FullBlogPlugin: Fix for unicode error related to calendar month names in some locales.

Closes #3021, and thanks to hirobe for report and patch.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Odd Simon Simonsen.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.