Modify

Opened 9 years ago

Closed 8 years ago

Last modified 5 years ago

#4240 closed defect (worksforme)

[Patch] There is still error with non-ascii character if ticket's priorities or title contains non-ascii char

Reported by: Yunior Armando Hernandez Andrade Owned by: Felix Tiede
Priority: normal Component: TracTicketDepgraphPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

I just installed the pluggin and all requirements and give it a try... this error showed up

Trac detected an internal error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 171: ordinal not in range(128)

Attachments (1)

depgraph-encode-nonascii.patch (852 bytes) - added by Felix Tiede 9 years ago.
Patch to decode non-ascii characters into entities for tooltips

Download all attachments as: .zip

Change History (13)

comment:1 Changed 9 years ago by Felix Tiede

Status: newassigned

Do you have any non-ascii characters in your ticket's priorities or severities?

Did you try from a ticket without any non-ascii characters in its summary?

In the first case please try the latest revision ([4993]) and tell me if the problem remains.

comment:2 Changed 9 years ago by Yunior Armando Hernandez Andrade

well my trac was set for a spanish speaking development team so there are losts of accute caracters like (áéíóú) and probably some (äëïöü) but I'm not sure if those are non ascii caracters. Now i'm getting a similar error in some other parts of my trac, viewing some tickets details outputs the following error: File "build/bdist.linux-i686/egg/genshi/core.py", line 494, in escape

text = unicode(text).replace('&', '&') \

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1314: ordinal not in range(128)

so maybe it is not just your pluggin... anyway people will almost always (I did) download from any link with a zipped file than directly to repository so you should consider updating links to zipped files when creating a patch for you pluggin. I will keep track and report back... thanks.

comment:3 in reply to:  2 Changed 9 years ago by Felix Tiede

Replying to yahernandez@estudiantes.uci.cu:

well my trac was set for a spanish speaking development team so there are losts of accute caracters like (áéíóú) and probably some (äëïöü) but I'm not sure if those are non ascii caracters.

Characters with accents (like á) are most certainly non-ascii at least and Umlauts (like ä) are probably non-ascii.

Now i'm getting a similar error in some other parts of my trac, viewing some tickets details outputs the following error: File "build/bdist.linux-i686/egg/genshi/core.py", line 494, in escape

text = unicode(text).replace('&', '&') \

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1314: ordinal not in range(128)

That one looks familiar and I assume similar lines in my plugin to cause this error. I have to ask you to test a patch I'll attach later to confirm my suspicion. If it solves the problem the patch will be integrated and available via zip-link from the wiki page.

Changed 9 years ago by Felix Tiede

Patch to decode non-ascii characters into entities for tooltips

comment:4 Changed 9 years ago by Felix Tiede

Resolution: fixed
Status: assignedclosed

(In [5200]) Proposed patch for non-ASCII characters in ticket summaries. This hopefully fixes #4240.

comment:5 Changed 9 years ago by Felix Tiede

(In [5232]) Another run at encoding unicode in tooltips, refs #4240.

So far, this worked for characters 128-255.

comment:6 Changed 9 years ago by Felix Tiede

(In [5234]) This now also shows double quotes in tooltips. Refs #4240.

comment:7 Changed 9 years ago by Nicolas.Chaverou@…

Priority: highnormal
Resolution: fixed
Status: closedreopened

Just to say that, even with the new patches, we still have an error when having accents (éèà...) in our ticket summaries.

The displayed error is still the same : 'ascii' codec can't decode byte 0xc3 in position... For now, we wrote a function that strips the accent...

comment:8 Changed 9 years ago by Ilmars Poikans

Summary: doesn't generate anythingThere is still error with non-ascii character if ticket's priorities contains non-ascii char

I donwloaded plugin from SVN (version 5234). There is still problem, if ticket priority contains unicode character. Here is stack trace:

2009-02-22 18:45:39,887 Trac[formatter] ERROR: Macro DepGraph(None) failed
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/wiki/formatter.py", line 468, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/usr/lib/python2.5/site-packages/trac/wiki/formatter.py", line 179, in process
    text = self.processor(text)
  File "/usr/lib/python2.5/site-packages/trac/wiki/formatter.py", line 166, in _macro_processor
    text)
  File "build/bdist.linux-x86_64/egg/depgraph/depgraph.py", line 232, in expand_macro
    result += self._depgraph_all(formatter.req)
  File "build/bdist.linux-x86_64/egg/depgraph/depgraph.py", line 90, in _depgraph_all
    bgcolor, border = self._get_color(str(ticket[1]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u012b' in position 4: ordinal not in range(128)

comment:9 Changed 9 years ago by Felix Tiede

Resolution: fixed
Status: reopenedclosed

(In [5302]) Removed ASCII-bound type cast for coloring !depgraph nodes. Fixes #4240 (hopefully).

comment:10 Changed 9 years ago by F. Duarte

Resolution: fixed
Status: closedreopened
Summary: There is still error with non-ascii character if ticket's priorities contains non-ascii charThere is still error with non-ascii character if ticket's priorities or title contains non-ascii char

Sorry, I just tryed it these days and it still doesn't work with accents in ticket's summary.

comment:11 Changed 8 years ago by Felix Tiede

Resolution: worksforme
Status: reopenedclosed

I've tested again with a newly created ticket with unicode characters and it works here.

I'm sorry, I can't reproduce the bug.

comment:12 Changed 8 years ago by Adrian Fritz

Summary: There is still error with non-ascii character if ticket's priorities or title contains non-ascii char[Patch] There is still error with non-ascii character if ticket's priorities or title contains non-ascii char

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Felix Tiede.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.