ChronicGaming / xbmc-addons

Automatically exported from code.google.com/p/xbmc-addons
0 stars 0 forks source link

TED plugin cannot handle non-ASCII characters when scraping newest talks #85

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The "Newest Talks" link doesn't work at the moment because there it encounters 
non-ascii characters. I suspect "Béatrice Coron: Stories cut from paper". The 
following stack is logged:

{{{20:28:25 T:2875194224 M:1538293760   ERROR: Error Type: 
exceptions.UnicodeEncodeError
20:28:25 T:2875194224 M:1538293760   ERROR: Error Contents: 'ascii' codec can't 
encode character u'\xe9' in position 0: ordinal not in range(128)
20:28:25 T:2875194224 M:1538293760   ERROR: Traceback (most recent call last):
                                              File "/home/tim/.xbmc/addons/plugin.video.ted.talks/default.py", line 27, in ?
                                                ted_talks.Main()
                                              File "/home/tim/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 181, in __init__
                                                self.checkMode()
                                              File "/home/tim/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 240, in checkMode
                                                UI().newTalks()
                                              File "/home/tim/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 116, in newTalks
                                                for talk in newTalks.getNewTalks():
                                              File "/home/tim/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", line 108, in getNewTalks
                                                title = cleanHTML(talk.dt.a['title'])
                                              File "/home/tim/.xbmc/addons/plugin.video.ted.talks/resources/lib/util.py", line 56, in cleanHTML
                                                tmp.append(str(ns))
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 0: ordinal not in range(128)}}}

Fix seems trivial. Attached a patch for resources/lib/util.py.

Original issue reported on code.google.com by moregin...@gmail.com on 29 Oct 2011 at 8:07

Attachments:

GoogleCodeExporter commented 9 years ago
fixed in version 2.2.4 - thanks.

i'm sorry i didn't see it before but this isn't really my project ;)

Original comment by cptsp...@gmail.com on 29 Nov 2011 at 9:27

GoogleCodeExporter commented 9 years ago
No problem, thanks for fixing. Is there a better place to file issues?

Original comment by moregin...@gmail.com on 30 Nov 2011 at 11:37