Modify

Opened 9 years ago

Closed 9 years ago

#3449 closed defect (duplicate)

mastertickets.webui causes genshi traceback

Reported by: bernd.tegge@… Owned by: Noah Kantrowitz
Priority: normal Component: MasterTicketsPlugin
Severity: blocker Keywords: postgres, i18n
Cc: Trac Release: 0.11

Description

When I enable mastertickets.web_ui on an OpenSuse 11.0 install I get the following traceback in my browser when I try to view a ticket.

Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/api.py", line 339, in send_error
    'text/html')
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/chrome.py", line 726, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "build/bdist.linux-i686/egg/genshi/core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "build/bdist.linux-i686/egg/genshi/output.py", line 57, in encode
    for chunk in iterator:
  File "build/bdist.linux-i686/egg/genshi/output.py", line 307, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-i686/egg/genshi/output.py", line 749, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-i686/egg/genshi/output.py", line 588, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-i686/egg/genshi/output.py", line 703, in __call__
    text = mjoin(textbuf, escape_quotes=False)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1520: ordinal not in range(128)

According to the Genshi-FAQ this is not a genshi problem.

Versions: Python 2.5.2, Trac 0.11, Genshi 0.5.1 or Genshi 0.6dev_r914, MasterTicketsPlugin-2.1.2, postgresql 8.3.1.

An earlier install on a previous version of OpenSuse (Python 2.5.1, Trac 0.11, Genshi 0.6dev_r884, MasterTicketsPlugin-2.1.2, postgresql 8.2.6) did not show that problem.

Just an idea: As the computer (hopefully) uses utf-8 and locale de_DE-utf8 throughout the system could this be caused by umlauts from the error message caused by #2658 ?

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by bernd.tegge@…

Keywords: postgres i18n added; web_ui genshi removed
Trac Release: 0.100.11

ok, I've patched model.py according to #2658 (see below). This seems to fix the problem for me.

diff -r -C3 masterticketsplugin/mastertickets/model.py masterticketsplugin-org//mastertickets/model.py
*** masterticketsplugin/mastertickets/model.py  2008-07-24 16:53:28.000000000 +0200
--- masterticketsplugin-org//mastertickets/model.py 2008-01-02 00:09:31.000000000 +0100
***************
*** 19,29 ****
          db = db or self.env.get_db_cnx()
          cursor = db.cursor()
          
!         cursor.execute('SELECT dest FROM mastertickets WHERE source=\'%s\' ORDER BY dest', (self.tkt.id,))
          self.blocking = set([num for num, in cursor])
          self._old_blocking = copy.copy(self.blocking)
          
!         cursor.execute('SELECT source FROM mastertickets WHERE dest=\'%s\' ORDER BY source', (self.tkt.id,))
          self.blocked_by = set([num for num, in cursor])
          self._old_blocked_by = copy.copy(self.blocked_by)
          
--- 19,29 ----
          db = db or self.env.get_db_cnx()
          cursor = db.cursor()
          
!         cursor.execute('SELECT dest FROM mastertickets WHERE source=%s ORDER BY dest', (self.tkt.id,))
          self.blocking = set([num for num, in cursor])
          self._old_blocking = copy.copy(self.blocking)
          
!         cursor.execute('SELECT source FROM mastertickets WHERE dest=%s ORDER BY source', (self.tkt.id,))
          self.blocked_by = set([num for num, in cursor])
          self._old_blocked_by = copy.copy(self.blocked_by)
          

comment:2 Changed 9 years ago by Noah Kantrowitz

Resolution: duplicate
Status: newclosed

Duplicate of #2658

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
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.