Modify

Opened 6 years ago

Closed 5 years ago

Last modified 18 months 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: yahernandez@… Owned by: ftiede
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 ftiede 6 years ago.
Patch to decode non-ascii characters into entities for tooltips

Download all attachments as: .zip

Change History (13)

comment:1 Changed 6 years ago by ftiede

  • Status changed from new to assigned

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 follow-up: Changed 6 years ago by yahernandez@…

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 6 years ago by ftiede

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 6 years ago by ftiede

Patch to decode non-ascii characters into entities for tooltips

comment:4 Changed 6 years ago by ftiede

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:5 Changed 6 years ago by ftiede

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

So far, this worked for characters 128-255.

comment:6 Changed 6 years ago by ftiede

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

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

  • Priority changed from high to normal
  • Resolution fixed deleted
  • Status changed from closed to reopened

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 6 years ago by ilmars@…

  • Summary changed from doesn't generate anything to There 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 6 years ago by ftiede

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:10 Changed 6 years ago by fduarte

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from There is still error with non-ascii character if ticket's priorities contains non-ascii char to There 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 5 years ago by ftiede

  • Resolution set to worksforme
  • Status changed from reopened to closed

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 5 years ago by AdrianFritz

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

Add Comment

Modify Ticket

Action
as closed The owner will remain ftiede.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.