Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#6733 closed defect (fixed)

Cannot use non-ascii chars in Milestone group name

Reported by: trac-ja@… Owned by: Christopher Lenz
Priority: normal Milestone: 0.11
Component: roadmap Version: 0.11b1
Severity: normal Keywords: config unicode
Cc: trac-ja@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

If trac.ini includes with non-ascii(i.e. Japanese) characters in [milestone-groups] section, Trac dumps stacktrace as UnicodeDecodeError.

[milestone-groups]
NonAsciiClosed = closed
NonAsciiClosed.order = 0
NonAsciiClosed.css_class = closed
NonAsciiClosed.query_args = group=resolution
NonAsciiClosed.overall_completion = true

NonAsciiActive = *
NonAsciiActive.order = 1
NonAsciiActive.css_class = open

NonAsciiNew = new,reopened
NonAsciiNew.order = 2
NonAsciiNew.css_class = new

I think, it should be able to append label to milestone group name, and I wrote a patch (source:trunk@6429).

When apply this patch, we can write above case to:

[milestone-groups]
closed = closed
closed.order = 0
closed.query_args = group=resolution
closed.overall_completion = true
closed.label = NonAsciiClosed

active = *
active.order = 1
active.css_class = open
active.label = NonAsciiActive

new = new,reopened
new.order = 2
new.label = NonAsciiNew

# s/NonAscii[A-Z][a-z]+/Japanese or non-ascii chars/

Attachments (1)

Trac-0.11dev_r6429-milestonegroupname.patch (701 bytes ) - added by trac-ja@… 17 years ago.
Patch against source:trunk@6429

Download all attachments as: .zip

Change History (2)

by trac-ja@…, 17 years ago

Patch against source:trunk@6429

comment:1 by Christian Boos, 17 years ago

Keywords: config unicode added
Resolution: fixed
Status: newclosed

Patch applied in [6571], together with some docs (the TracIni#milestone-groups-section was updated as well). By the way, I'd really like to know the real name behind trac-ja, as I think you deserve your entry in our THANKS file!

Note that the problem with the UnicodeDecodeError will surface again, I'm sure. We would have to make some quite extensive changes in trac/config.py in order to cope with unicode keys. Ideally, that's what we should do, but I'm not really sure if it would not be quicker to completely drop the remaining bits of ConfigParser and do everything ourselves. Large parts are already duplicated / overriden anyway to take care of the [inherit] file logic. The other main advantages of that would be to preserve the ordering of entries, drop the special behavior of % in the values, and last but not least, don't throw away the comments when rewriting the .ini file.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.