Modify

Opened 2 years ago

Closed 2 years ago

Last modified 20 months ago

#10112 closed defect (fixed)

UnicodeDecodeError when trying to see Roadmap

Reported by: AdrianFritz 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 2 years ago by AdrianFritz

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 2 years ago by falkb

  • Cc thomasd added

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 2 years ago by AdrianFritz

Perfect !! Thanks falkb !!

comment:4 Changed 2 years ago by falkb

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

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

comment:5 follow-up: Changed 2 years ago by AdrianFritz

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 2 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:7 Changed 2 years ago by falkb

  • Owner changed from crossroad to falkb
  • Status changed from reopened to new

comment:8 Changed 2 years ago by falkb

  • Status changed from new to assigned

comment:9 in reply to: ↑ 5 Changed 2 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 follow-up: Changed 2 years ago by AdrianFritz

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

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 22 months 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 20 months 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 20 months ago by AdrianFritz

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from falkb. Next status will be 'closed'.
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.