#10678 closed defect (fixed)
UnicodeEncodeError while unicode digits as numbered list in wiki
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.4 |
Component: | wiki system | Version: | 0.12-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If the following text is in comment of ticket page, UnicodeEncodeError
is logged in trac.log.
①. circled digit one
The error;
... File "home/jun66j5/venv/trac-0.12/lib/python2.4/site-packages/trac/wiki/formatter.py", line 1161, in replace File "home/jun66j5/venv/trac-0.12/lib/python2.4/site-packages/trac/wiki/formatter.py", line 1157, in handle_match File "home/jun66j5/venv/trac-0.12/lib/python2.4/site-packages/trac/wiki/formatter.py", line 801, in _list_formatter UnicodeEncodeError: 'decimal' codec can't encode character u'\u2460' in position 0: invalid decimal Unicode string
Wiki parser uses \d
with re.UNICODE
and the regexp matches unicode digits, however a subset of these characters cannot be convert with int()
.
I don't think it expects to match unicode digits. unicode-digits-wiki-list.diff uses [0-9]
instead.
Attachments (1)
Change History (12)
by , 13 years ago
Attachment: | unicode-digits-wiki-list.diff added |
---|
follow-up: 5 comment:1 by , 13 years ago
comment:2 by , 13 years ago
Just lurking around: the comments in the test part of the patch seem to be missing a verb:
Unicode digits will not start a numbered list?
comment:3 by , 13 years ago
I wonder if we have more occurrences of this issue (i.e. using \d
in a regexp, and converting the resulting match using int()
).
comment:4 by , 13 years ago
I just looked into the source about the same occurrences, again. Then I cannot find. However, \d
with re.UNICODE
occurs the similar issues.
Wiki system should not convert the following text to Trac links.
{④②} #①-④② #T①-④② [④②] r④② changeset:④② [①-④②] log:@①-④②
I'll work the new issue later.
follow-up: 6 comment:5 by , 13 years ago
Replying to cboos:
[OT] Btw, tell me if you'd like to get a jomae.git on t.e.o. like the cboos.git I added for me.
Great! Would you create jomae.git
repository for me?
I was lately thinking about creating a plugin which would add an "Attach branch" button next to "Attach file" in tickets, as a way to avoid having to go through patches…
Nice idea!
comment:6 by , 13 years ago
Replying to jomae:
Replying to cboos:
[OT] Btw, tell me if you'd like to get a jomae.git on t.e.o. like the cboos.git I added for me.
Great! Would you create
jomae.git
repository for me?
Done. See TracTeam/Repositories#git for details.
follow-up: 8 comment:7 by , 13 years ago
Jun, would it make sense to apply this patch to 0.12-stable now, and to merge it in time for 1.0?
comment:8 by , 13 years ago
Replying to rblank:
Jun, would it make sense to apply this patch to 0.12-stable now, and to merge it in time for 1.0?
I've reworked about the cases in comment:4. repos:jomae.git:ticket10678/0.12-stable and repos:jomae.git:ticket10678/trunk for 1.0.
Ok to apply?
comment:10 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:11 by , 12 years ago
Owner: | set to |
---|
Looks good!
[OT] Btw, tell me if you'd like to get a jomae.git on t.e.o. like the cboos.git I added for me.
I was lately thinking about creating a plugin which would add an "Attach branch" button next to "Attach file" in tickets, as a way to avoid having to go through patches…