Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10141 closed defect (fixed)

UnicodeEncodeError: ('ascii', u'0 \ud2f0\ucf13\uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.', 2, 5, 'ordinal not in range(128)')

Reported by: Genie Owned by: Russ Tyndall
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords: babel unicode
Cc: Ryan J Ollos Trac Release: 0.12

Description

Hi~

The UNICODE error is generated in the [Ticket Hours] and [Ticket Hours with Description] reports.

The trac0.12-Permissions branch has UNICODE issue on babel environment only, especially on multi-byte language environment such as CJK(Chinese-Japanese-Korean).


System Information

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1

Trac 0.12.3
Babel 0.9.5
Genshi 0.6
mod_wsgi 3.3 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
pysqlite 2.6.0
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
setuptools 0.6c12
SQLite 3.6.2
Subversion 1.6.15 (r1038135)
jQuery 1.4.4

Enabled Plugins

iniadmin 0.2
timingandestimationplugin 1.2.7b

Python Traceback

Traceback (most recent call last):
  File "build/bdist.win32/egg/trac/web/main.py", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.win32/egg/trac/web/main.py", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.win32/egg/trac/ticket/report.py", line 118, in process_request
    template, data, content_type = self._render_view(req, id)
  File "build/bdist.win32/egg/trac/ticket/report.py", line 532, in _render_view
    if resource.realm.upper()+'_VIEW' not in req.perm(resource):
  File "build/bdist.win32/egg/trac/perm.py", line 553, in has_permission
    return self._has_permission(action, resource)
  File "build/bdist.win32/egg/trac/perm.py", line 567, in _has_permission
    check_permission(action, perm.username, resource, perm)
  File "build/bdist.win32/egg/trac/perm.py", line 454, in check_permission
    perm)
  File "build/bdist.win32/egg/timingandestimationplugin/ticket_policy.py", line 23, in check_permission
    rtn = self.check_ticket_access(perm, resource, username)
  File "build/bdist.win32/egg/timingandestimationplugin/ticket_policy.py", line 61, in check_ticket_access
    self.log.warning("Internal: TandE ticket_policy failed to find a ticket for %s : error: %s" %  (res, e))

UnicodeEncodeError: ('ascii', u'0 \ud2f0\ucf13\uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.', 2, 5, 'ordinal not in range(128)')

Attachments (0)

Change History (4)

comment:1 Changed 12 years ago by Genie

This patch fixes unicode issue.

  • branches/trac0.12-Permissions/timingandestimationplugin/ticket_policy.py

     
    5858        try:
    5959            tkt = Ticket(self.env, res.id)
    6060        except Exception, e:
    61             self.log.warning("Internal: TandE ticket_policy failed to find a ticket for %s : error: %s" %  (res, e))
     61            self.log.warning("Internal: TandE ticket_policy failed to find a ticket for %s : error: %s" %  (res, unicode(e)))
    6262            return None # Ticket doesn't exist / ticket id was invalid
    6363        private_tkt = tkt['internal'] == '1'
    6464

comment:2 Changed 12 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed

comment:3 Changed 12 years ago by Russ Tyndall

Resolution: fixed
Status: newclosed

(In [12035]) prevent unicode error fix #10141

comment:4 Changed 12 years ago by Russ Tyndall

Thanks so much for the bug report and patch, sorry it took me a while to respond, I sometimes dont seem to get notifications

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Russ Tyndall.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.