Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10112 closed defect (fixed)

UnicodeDecodeError when trying to see Roadmap

Reported by: Adrian Fritz Owned by: falkb
Priority: normal Component: SimpleMultiProjectPlugin
Severity: normal Keywords: UnicodeDecodeError
Cc: thomasd Trac Release: 0.12

Description

When trying to see Roadmap got: "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: ordinal "

Related to #10074

Attachments (0)

Change History (13)

comment:1 Changed 12 years ago by Adrian Fritz

Plugin version 0.0.2. Tested with

Python Traceback

Most recent call last:
 * File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/main.py", line 513, in _dispatch_request
 * File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/main.py", line 256, in dispatch
 * File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/chrome.py", line 816, in render_template
 * File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 132, in __or__
 * File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/chrome.py", line 955, in inner
 * File "/usr/local/lib/python2.6/dist-packages/SimpleMultiProject-0.0.2-py2.6.egg/simplemultiproject/roadmap.py", line 170, in filter_stream
 * File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/input.py", line 425, in HTML
 * File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
 * File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/input.py", line 432, in _coalesce
 * File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/input.py", line 327, in _generate
 * File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed
 * File "/usr/lib/python2.6/HTMLParser.py", line 148, in goahead
 * File "/usr/lib/python2.6/HTMLParser.py", line 249, in parse_starttag
 * File "/usr/lib/python2.6/HTMLParser.py", line 387, in unescape
 * File "/usr/lib/python2.6/re.py", line 151, in sub

System Information:

User Agent: Mozilla/5.0 (Windows NT 6.1)
AppleWebKit/536.5 (KHTML, like Gecko)
Chrome/19.0.1084.56 Safari/536.5
Trac 0.12
Trac 0.12
Genshi 0.6
mod_wsgi 2.8 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
psycopg2 2.0.13
Pygments 1.4
Python 2.6.5 (r265:79063, Apr 16 2010, 14:15:55) [GCC 4.4.3]
Python 2.6.5 (r265:79063, Apr 16 2010, 14:15:55) [GCC 4.4.3]
setuptools 0.6
setuptools 0.6
Subversion 1.6.6 (r40053)
jQuery 1.4.2

comment:2 Changed 12 years ago by falkb

Cc: thomasd added; anonymous removed

Does this one help?:

  • ./simplemultiproject/roadmap.py

     
    167167
    168168    def filter_stream(self, req, method, filename, stream, data):
    169169        if filename.startswith("roadmap"):
    170             stream_roadmap = HTML(stream)
     170            stream_roadmap = HTML(to_unicode(stream))
    171171            stream_milestones = HTML(stream_roadmap.select('//div[@class="roadmap"]/div[@class="milestones"]'))
    172172           
    173173            milestones = self.__extract_milestones_array(stream_milestones.select('//div[@class="milestone"]/div/h2/a/em'))

comment:3 Changed 12 years ago by Adrian Fritz

Perfect !! Thanks falkb !!

comment:4 Changed 12 years ago by falkb

Resolution: fixed
Status: newclosed

(In [11680]) fixed #10112: stream must be converted to unicode before processing in filter_stream(). Thanks to AdrianFritz for reporting.

comment:5 Changed 12 years ago by Adrian Fritz

falkb, I´m reopening the ticket, because, now needs one more related fix, shown below

File ".../SimpleMultiProject-0.0.3dev_11696-py2.6.egg/simplemultiproject/roadmap.py", line 178, in filter_stream

 - stream_milestones = HTML(stream_roadmap.select('//div[@class="roadmap"]/div[@class="milestones"]'))
 + stream_milestones = HTML(to_unicode(stream_roadmap.select('//div[@class="roadmap"]/div[@class="milestones"]')))

comment:6 Changed 12 years ago by anonymous

Resolution: fixed
Status: closedreopened

comment:7 Changed 12 years ago by falkb

Owner: changed from Christopher Paredes to falkb
Status: reopenednew

comment:8 Changed 12 years ago by falkb

Status: newassigned

comment:9 in reply to:  5 Changed 12 years ago by falkb

Replying to AdrianFritz:

falkb, I´m reopening the ticket, because, now needs one more related fix, shown below

Hmm... strange. I thought I turn the stream already to_unicode() in line 177:

L177  stream_roadmap = HTML(to_unicode(stream))
L178  stream_milestones = HTML(stream_roadmap.select('//div[@class="roadmap"]/div[@class="milestones"]'))

I thought that is enough, isn't it?

comment:10 Changed 12 years ago by Adrian Fritz

Resolution: fixed
Status: assignedclosed

I´m sorry because my noise. It´s working properly with latest plugin version. My mistake (I had one improper set-up).

comment:11 Changed 12 years ago by falkb

(In [12060]) bugfix (refs #10112, refs #10365): now I also experienced that unicode decode error (with new Trac-1.0), fixed with patch of AdrianFritz. Thanks

comment:12 in reply to:  10 Changed 12 years ago by falkb

Replying to AdrianFritz:

I´m sorry because my noise. It´s working properly with latest plugin version. My mistake (I had one improper set-up).

Adrian, do you remember what you've exactly done to fix the Roadmap page error for you? It has hit us again in this new ticket #10651

comment:13 Changed 12 years ago by Adrian Fritz

I`ll check it again (because I do not remember now) and tell you by the end of this week.

Modify Ticket

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