#4820 closed defect (fixed)
[Patch] UnicodeDecode Error line 50 in ticketdeletete_admin.html
Reported by: | Owned by: | Noah Kantrowitz | |
---|---|---|---|
Priority: | normal | Component: | TicketDeletePlugin |
Severity: | normal | Keywords: | |
Cc: | Matthijs Kooijman | Trac Release: | 0.11 |
Description
Was solved by changing the line 50 as follows:
<td colspan="3" py:with="ptime=unicode(ticketdelete. changes[change].prettytime.decode('utf-8'))"><b>Change at ${ptime} by ${ticketdelete.changes[change].author}</b></td>
I have german locale setting, that might be the reason why prettytime contains characers that genshi doesn't like.
Attachments (0)
Change History (13)
comment:1 Changed 16 years ago by
comment:3 Changed 16 years ago by
Here is an alternative patch.
-
ticketdelete/web_ui.py
8 8 from trac.web.api import IRequestFilter 9 9 from trac.web.chrome import ITemplateProvider, add_script, add_stylesheet 10 10 from trac.util import sorted 11 from trac.util.datefmt import to_datetime, utc, to_timestamp 11 from trac.util.datefmt import to_datetime, utc, to_timestamp, format_datetime 12 12 13 13 import re 14 14 import traceback … … 100 100 c_data = ticket_data.setdefault(to_timestamp(time), {}) 101 101 c_data.setdefault('fields', {})[field] = {'old': oldvalue, 'new': newvalue} 102 102 c_data['author'] = author 103 # FIXME: The datetime handling is not working - enable 104 # for traceback 105 c_data['prettytime'] = strftime('%a, %d %b %Y %H:%M:%S',time.timetuple()) 103 c_data['prettytime'] = format_datetime(time, '%a, %d %b %Y %H:%M:%S') 106 104 107 105 # Check the boxes next to change number `selected` 108 106 time_list = list(sorted(ticket_data.iterkeys()))
comment:4 Changed 15 years ago by
Summary: | UnicodeDecode Error line 50 in ticketdeletete_admin.html → [Patch] UnicodeDecode Error line 50 in ticketdeletete_admin.html |
---|
comment:5 Changed 15 years ago by
I run into the same problem with my german python installation. I tried both patches, but the patch with
strftime('%x %X',time.timetuple())
seems more appropriate because the other one still inserts german month names into the web display while the other components of trac are displayed in english. Here I just changed the locale for displaying times like "DD.MM.YYYY" instead of "MM/DD/YYYY". So "%x %X" seems to be more appropriate.
comment:6 Changed 15 years ago by
Cc: | Matthijs Kooijman added; anonymous removed |
---|
I've also seen this problem with a french locale. Using the %x %X patch works for me. Any chance to include this?
comment:7 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 Changed 12 years ago by
If anyone is still using this plugin, I appreciate if you can post feedback on whether [11790] fixed the issue.
comment:9 Changed 12 years ago by
I'm still using this plugin every other day or so to delete spam tickets :-D
I just tried 2.0.1 to find a ticket where the problem occurred and then 2.0.2 / r11790 which fixes the problem for me (french locale).
Thanks!
comment:11 Changed 12 years ago by
matthijs: Thanks for reporting back. The plugin is no longer needed with Trac 0.12, but I'm trying to wrap up the major issues that affect 0.11 users, since it appears there are still several people using this plugin. If any of the open issues are affecting you, please assign the tickets to me and I'll get them fixed.
comment:12 Changed 12 years ago by
We're still running on 0.11, so ticketdelete is useful for me still. I just looked through the list of tickets, there's nothing that I've ran into on first glance, so everything is pretty functional for me. I think there was some issue with deleting changes (IIRC using the checkmarks on complete changes didn't work or something, but the Delete Change button did), but that doesn't really bother me, so I'm fine!
comment:13 Changed 12 years ago by
Thanks for checking. I'll CC you on any other tickets that I make changes against, in case you might have an interest in the fix.
I hit this and fixed it by using the locale format "%x %X":
ticketdelete/web_ui.py
a, %d %b %Y %H:%M:%S',time.timetuple())