Ticket #4240 (closed defect: worksforme)

Opened 4 years ago

Last modified 3 years ago

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

Reported by: yahernandez@estudiantes.uci.cu Assigned to: 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

depgraph-encode-nonascii.patch (0.8 kB) - added by ftiede on 12/10/08 23:51:17.
Patch to decode non-ascii characters into entities for tooltips

Change History

12/10/08 14:04:08 changed 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.

(follow-up: ↓ 3 ) 12/10/08 16:04:51 changed by 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. 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.

(in reply to: ↑ 2 ) 12/10/08 23:15:31 changed 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.

12/10/08 23:51:17 changed by ftiede

  • attachment depgraph-encode-nonascii.patch added.

Patch to decode non-ascii characters into entities for tooltips

02/05/09 11:08:35 changed by ftiede

  • status changed from assigned to closed.
  • resolution set to fixed.

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

02/10/09 12:15:18 changed by ftiede

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

So far, this worked for characters 128-255.

02/10/09 13:25:24 changed by ftiede

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

02/18/09 10:58:36 changed by Nicolas.Chaverou@irisa.fr

  • priority changed from high to normal.
  • status changed from closed to reopened.
  • resolution deleted.

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...

02/22/09 17:57:30 changed by ilmars@delibero.lv

  • 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)

02/23/09 12:00:21 changed by ftiede

  • status changed from reopened to closed.
  • resolution set to fixed.

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

03/19/09 18:29:48 changed by fduarte

  • status changed from closed to reopened.
  • resolution deleted.
  • 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.

07/29/09 10:06:10 changed by ftiede

  • status changed from reopened to closed.
  • resolution set to worksforme.

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.

01/04/10 18:11:51 changed 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/Change #4240 ([Patch] There is still error with non-ascii character if ticket's priorities or title contains non-ascii char)




Change Properties
Action