Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 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: bobbysmith007
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords: babel unicode
Cc: rjollos 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 2 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 2 years ago by rjollos

  • Cc rjollos added; anonymous removed

comment:3 Changed 2 years ago by bobbysmith007

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

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

comment:4 Changed 2 years ago by bobbysmith007

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

Add Comment

Modify Ticket

Action
as closed The owner will remain bobbysmith007.
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.