Edgewall Software

Ticket #6733 (closed defect: fixed)

Opened 11 months ago

Last modified 11 months ago

Cannot use non-ascii chars in Milestone group name

Reported by: trac-ja@… Owned by: cmlenz
Priority: normal Milestone: 0.11
Component: roadmap Version: 0.11b1
Severity: normal Keywords: config unicode
Cc: trac-ja@…

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

Trac-0.11dev_r6429-milestonegroupname.patch (0.7 KB) - added by trac-ja@… 11 months ago.
Patch against source:trunk@6429

Change History

Changed 11 months ago by trac-ja@…

Patch against source:trunk@6429

Changed 11 months ago by cboos

  • keywords config unicode added
  • status changed from new to closed
  • resolution set to fixed

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.

Add/Change #6733 (Cannot use non-ascii chars in Milestone group name)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cmlenz. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.