Bugs item #1594642, was opened at 2006-11-11 02:39
Message generated for change (Comment added) made by sf-robot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1594642&group_id=46652
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: program guide
Group: 1.6.0
>Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: [EMAIL PROTECTED] (bacademy)
Assigned to: Nobody/Anonymous (nobody)
Summary: freevo webserver search returns no results
Initial Comment:
Another unicode error, when program title has latin-1
characters like "öä":
2006/11/11 11:42 EET [HTTPChannel,2,127.0.0.1]
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/twisted/web/http.py",
line 557, in requestReceived
self.process()
File "/usr/lib/python2.4/site-packages/twisted/web/server.py",
line 153, in process
self.render(resrc)
File "/usr/lib/python2.4/site-packages/twisted/web/server.py",
line 160, in render
body = resrc.render(self)
File "/usr/lib/python2.4/site-packages/twisted/web/xmlrpc.py",
line 118, in render
defer.maybeDeferred(function,
*args).addErrback(
--- <exception caught here> ---
File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py",
line 107, in maybeDeferred
result = f(*args, **kw)
File "/usr/lib/python2.4/site-packages/freevo/helpers/recordserver.py",
line 807, in xmlrpc_findMatches
(status, response) =
self.findMatches(find, movies_only)
File "/usr/lib/python2.4/site-packages/freevo/helpers/recordserver.py",
line 378, in findMatches
_debug_('PROGRAM MATCH: %s' %
prog.decode())
File "/usr/lib/python2.4/site-packages/freevo/tv/epg_types.py",
line 91, in __str__
title = self.title.encode('utf-8')
exceptions.UnicodeDecodeError: 'ascii' codec
can't decode byte 0xe4 in position 36: ordinal not in
range(128)
----------------------------------------------------------------------
>Comment By: SourceForge Robot (sf-robot)
Date: 2006-11-30 19:20
Message:
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
----------------------------------------------------------------------
Comment By: [EMAIL PROTECTED] (bacademy)
Date: 2006-11-13 15:10
Message:
Logged In: YES
user_id=816562
I tend to read "encode" as "to" and "decode" as from.
I also helps to remember that there is always a pair
(from,to) of strings, and both encodings must be known.
It is far easier if strings are always kept as unicode,
because an unicode string knows its encoding.
So s.encode('char-set') will never fail if s can be
encoded in 'char-set'. Problems arise because
non-unicode python strings can contain non-ascii
characters, but the default character set is ascii when
encoding or decoding.
Now if I recall, XML parser always should return unicode
strings which is good. But perhaps that is converted to
basic python string in freevo in some cases, which
should not be done. I'll need to take a look how freevo
handles it. Keeping everything in freevo in UTF-8 might
be a good solution, as it can represent everything, and
it is a superset of ascii (7 bit ascii chars only take a
byte).
Another curve ball is the terminal -- it is a third
character set to consider, some strings will not render
correctly on terminals
(http://www.jorendorff.com/articles/unicode/python.html)
Unicode encode,decode should not really come up in that
many places in the code. And btw.
sys.setdefaultencoding() is only available in the
init.py, which is bit of a bummer... I haven't really
looked into why is that yet, and is there a
workaround...
----------------------------------------------------------------------
Comment By: Duncan Webb (duncanwebb)
Date: 2006-11-12 21:29
Message:
Logged In: YES
user_id=104395
AFAIK it uses the twisted stuff, but I must admit that I
find the python unicode handling less intuitive than it
should be decode and encode are not great names.
I may be better to add into local_conf, but I've not tried it:
sys.setdefaultencoding('iso-8859-1')
instead of changing site.py as site.py maybe overwritten.
----------------------------------------------------------------------
Comment By: [EMAIL PROTECTED] (bacademy)
Date: 2006-11-12 13:47
Message:
Logged In: YES
user_id=816562
Ok, I'll try the svn version.
btw. what does freevo user for XML parsing? Many Unicode related bugs
look like the parser would not
return character strings in the xml documents encoding. I haven't been
reading the code much (yet),
just guessing...
----------------------------------------------------------------------
Comment By: Duncan Webb (duncanwebb)
Date: 2006-11-11 03:30
Message:
Logged In: YES
user_id=104395
Would you like to try the rel-1-6 svn version?
I have applied a fix in rel-1-6 at r8569, that should fix this.
----------------------------------------------------------------------
Comment By: [EMAIL PROTECTED] (bacademy)
Date: 2006-11-11 03:13
Message:
Logged In: YES
user_id=816562
Looks like freevo is not respecting the encoding in
TV.xml
A successful workaround for me was to set the
default encoding to iso-8859-1 in python's site.py,
the search started working. I presume this same
workaround would fix Unicode*Errors for most
European users.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1594642&group_id=46652
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel