Modify

Opened 6 years ago

Closed 4 years ago

#4855 closed defect (fixed)

UnicodeDecodeError using hr_HR.UTF8

Reported by: anonymous Owned by: k0s
Priority: normal Component: TracHoursPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When I try to access /hours using hr_HR.UTF8 encoding this error pops up:

Genshi UnicodeDecodeError error while rendering template '/usr/lib/python2.5/site-packages/TracHoursPlugin-0.3.1-py2.5.egg/trachours/templates/hours_query_results.html', line 59, char -1

Using en_EN.UTF8 everything works fine

Attachments (2)

hours_query_results.html.diff.gz (501 bytes) - added by nac 5 years ago.
diff
hours_query_results.html.diff.2.gz (501 bytes) - added by nac 5 years ago.
diff2

Download all attachments as: .zip

Change History (14)

comment:1 Changed 5 years ago by nac

I met same error on ja_JP.utf8.

Genshi UnicodeDecodeError error while rendering template '/var/lib/trac/.egg-cache/TracHoursPlugin-0.3.1-py2.5.egg-tmp/trachours/templates/hours_query_results.html', line 59, char -1

Now I use trac 0.11-4

comment:2 follow-up: Changed 5 years ago by nac

As #4420, I added "to_unicode()" funcion to error template and the function works well. I don't have error message.
(I could not attatch the diff because of spam check.)

comment:3 in reply to: ↑ 2 Changed 5 years ago by k0s

Replying to nac:

As #4420, I added "to_unicode()" funcion to error template and the function works well. I don't have error message.
(I could not attatch the diff because of spam check.)

If you upload the diff or just paste it, i'd be happy to include it. It is difficult for me to test here, and TracHoursPlugin is no longer a company priority, so my efforts towards its maintainence will be minimal.

Changed 5 years ago by nac

diff

comment:4 follow-up: Changed 5 years ago by nac

upload the diff.
(Beacuse spam check for upload file, it's gzipped.)

if I get same error on the other templates, I will make diff and paste again.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 5 years ago by k0s

Replying to nac:

upload the diff.
(Beacuse spam check for upload file, it's gzipped.)

if I get same error on the other templates, I will make diff and paste again.

I just get some random binary data after gunzipping. If its short, can you just paste it in a comment? thanks

comment:6 in reply to: ↑ 5 ; follow-up: Changed 5 years ago by nac

Replying to k0s:

I just get some random binary data after gunzipping. If its short, can you just paste it in a comment? thanks

Oops, sorry that. I attached a file gzipped twice.
I attache correct one.
And the diff contains spam blacklist term "href", so I could not paste entire file.
(when attachment file or comment contains href trac warns

500 Internal Server Error (Submission rejected as potential spam (Content contained these blacklisted patterns: ...)

and reject it. )

Changed 5 years ago by nac

diff2

comment:7 in reply to: ↑ 6 Changed 5 years ago by k0s

Replying to nac:

Replying to k0s:

I just get some random binary data after gunzipping. If its short, can you just paste it in a comment? thanks

Oops, sorry that. I attached a file gzipped twice.
I attache correct one.
And the diff contains spam blacklist term "href", so I could not paste entire file.
(when attachment file or comment contains href trac warns

500 Internal Server Error (Submission rejected as potential spam (Content contained these blacklisted patterns: ...)

and reject it. )

Still can't read the file. Maybe mail otaku about this? Still receive an error of it being a binary file.

comment:8 Changed 5 years ago by nac

Hmm, I just attach correct gzipped file, but it seems gzipped again. It means that attached file is gzipped twice. I don't know why.

trac Hack ticket system has a little bit too strict anti-spam scanner, it could be cause of false positive error, I think.
(Or just I don't understand the usage of the ticket system.)

Oh, anyway please decompress twice for the file. Sorry!

comment:9 Changed 5 years ago by nac

just diff.

$ diff  --ignore-matching-lines=href hours_query_results.html hours_query_results.html.new
54,58c54,58
<                       <py:when test="isinstance(value, datetime)">${dateinfo(value)}</py:when>
<                       <py:when test="name == 'reporter'">${authorinfo(value)}</py:when>
<                       <py:when test="name == 'cc'">${format_emails(ticket_context, value)}</py:when>
<                       <py:when test="name == 'owner' and value">${authorinfo(value)}</py:when>
<                       <py:otherwise>$value</py:otherwise>
---
>                       <py:when test="isinstance(value, datetime)">${to_unicode(dateinfo(value))}</py:when>
>                       <py:when test="name == 'reporter'">${to_unicode(authorinfo(value))}</py:when>
>                       <py:when test="name == 'cc'">${to_unicode(format_emails(ticket_context, value))}</py:when>
>                       <py:when test="name == 'owner' and value">${to_unicode(authorinfo(value))}</py:when>
>                       <py:otherwise>${to_unicode(value)}</py:otherwise>

comment:10 Changed 5 years ago by k0s

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

(In [6240]) fixes #4855

comment:11 Changed 5 years ago by nac

  • Resolution fixed deleted
  • Status changed from closed to reopened

I got same error again on another template, hours_ticket.html.
Here is its diff;

$ diff -c hours_ticket.html hours_ticket.html.org 
*** hours_ticket.html	2009-07-21 23:41:06.247474407 +0900
--- hours_ticket.html.org	2009-07-21 23:37:55.600403949 +0900
***************
*** 46,52 ****
  	  </td>
  	</py:choose>
  	<td>
! 	  ${to_unicode(record['date_started'])}
  	</td>
  	<td>
  	  ${record['comments']}
--- 46,52 ----
  	  </td>
  	</py:choose>
  	<td>
! 	  ${record['date_started']}
  	</td>
  	<td>
  	  ${record['comments']}

comment:12 Changed 4 years ago by AdrianFritz

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

Flagged as duplicates: #5482, #4377

At #4420 k0s points:

(In [5374]) use to_unicode helper function; hopefully fixes #4420

Add Comment

Modify Ticket

Action
as closed .
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.