Re: fix for crashing webserver in 1.9 with unicode program titles

Gary Steele <[email protected]>
Newsgroups gmane.comp.video.freevo.devel
Message-ID <[email protected]>
sorry, it's bit late at night and my cutting and pasting didn't go so
smoothley:

    cell = _('Sorry, the program description for %s is unavailable.') %
('<b>'+prog.title+'</b>')

becomes

    cell = _('Sorry, the program description for %s is unavailable.') %
('<b>'+Unicode(prog.title)+'</b>')

and

    self.res += "       <td "+opts+">"+data+"</td>\n"

becomes

    self.res += "       <td "+opts+">"+Unicode(data)+"</td>\n"

cheers,
gary
On Sat, Jun 19, 2010 at 2:34 AM, Gary Steele <[email protected]> wrote:

> i experienced this problem recently:
>
>
> http://www.mail-archive.com/[email protected]/msg18422.html
>
>
> <http://www.mail-archive.com/[email protected]/msg18422.html>i'm
> not sure if it's fixed in an upstream version, but if not, the fix is to
> manually throw in unicode conversions using the Unicode() function. For
> example, at:
>
>   File "/usr/share/freevo/htdocs/search.rpy", line 123, in _render
>
> the code:
>
>     cell = _('Sorry, the program description for %s is unavailable.') %
> ('<b>'+prog.title+'</b>')
>
> becomes:
>
>     cell = _('Sorry, the program description for %s is unavailable.') %
> ('<b>'+prog.title+'</b>')
>
> the same applies at
>
>  File "/usr/lib/python2.5/site-packages/freevo/www/web_types.py", line 355,
> in tableCell
>
> where the offending "data" should become Unicode(data):
>
>      self.res += "       <td "+opts+">"+strip_accents(data)+"</td>\n"
>
> this was already manually hacked in tv/programitem.py for the program
> titles. there is probably a better way to do this somewhere else in the code
> to handle unicode program titles (may already be upstream?)
>
> cheers,
> gary
>



-- 
Dr. Gary Steele
Quantum Transport Group, B003
Kavli Institute of Nanotechnology Delft
Delft University of Technology
Lorentzweg 1
2613 VG Delft, The Netherlands
Office: +31-15-278-8426
Mobile: +31-64-667-4938
Email: [email protected]

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo

_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.