[mythtv-commits] Ticket #4917: ofdb.py: charset issues

MythTV mythtv at cvs.mythtv.org
Mon Mar 10 21:12:30 UTC 2008


#4917: ofdb.py: charset issues
------------------------------+---------------------------------------------
 Reporter:  laga at laga.ath.cx  |        Owner:  ijr    
     Type:  defect            |       Status:  new    
 Priority:  minor             |    Milestone:  unknown
Component:  mythtv            |      Version:  unknown
 Severity:  medium            |   Resolution:         
  Mlocked:  0                 |  
------------------------------+---------------------------------------------

Comment(by anonymous):

 I've created a small wrapper script which converts all input to
 iso8859-15:

 {{{
 #!/bin/sh
 ARG=`echo $@ | iconv -f UTF-8 -t iso8859-15`
 /usr/share/mythtv/mythvideo/scripts/ofdb.py $ARG
 }}}

 When using this script and commenting out line 105 as shown above, ofdb.py
 almost works. Searching for titles works fine and umlauts will show up
 correctly in MythVideo. For some IDs, ofdb.py will give me errors, though:

 {{{
 laga at prometheus:~$  /usr/share/mythtv/mythvideo/scripts/ofdb.py -D "35767
 ,Fluch-der-Karibik"
 # Traceback (most recent call last):
 #   File "/usr/share/mythtv/mythvideo/scripts/ofdb.py", line 313, in
 search_data
 #     doc = reader.fromString(content)
 #   File "/usr/lib/python2.5/site-
 packages/_xmlplus/dom/ext/reader/HtmlLib.py", line 69, in fromString
 #     return self.fromStream(stream, ownerDoc, charset)
 #   File "/usr/lib/python2.5/site-
 packages/_xmlplus/dom/ext/reader/HtmlLib.py", line 27, in fromStream
 #     self.parser.parse(stream)
 #   File "/usr/lib/python2.5/site-
 packages/_xmlplus/dom/ext/reader/Sgmlop.py", line 57, in parse
 #     self._parser.parse(stream.read())
 #   File "/usr/lib/python2.5/site-
 packages/_xmlplus/dom/ext/reader/Sgmlop.py", line 160, in finish_starttag
 #     unicode(value, self._charset))
 #   File "/usr/lib/python2.5/site-packages/_xmlplus/dom/Element.py", line
 170, in setAttributeNS
 #     raise InvalidCharacterErr()
 # Traceback (most recent call last):
 #   File "/usr/share/mythtv/mythvideo/scripts/ofdb.py", line 458, in
 <module>
 #     main()
 #   File "/usr/share/mythtv/mythvideo/scripts/ofdb.py", line 444, in main
 #     search_data(options.data_search, options.ratings_from)
 #   File "/usr/share/mythtv/mythvideo/scripts/ofdb.py", line 357, in
 search_data
 #     print_exception(traceback.format_exc())
 #   File "/usr/share/mythtv/mythvideo/scripts/ofdb.py", line 53, in
 print_exception
 #     comment_out(line)
 #   File "/usr/share/mythtv/mythvideo/scripts/ofdb.py", line 41, in
 comment_out
 #     print("# %s" % (str,))
 #   File "/usr/lib/python2.5/codecs.py", line 303, in write
 #     data, consumed = self.encode(object, self.errors)
 # UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 26:
 ordinal not in range(128)
 }}}

 This is without the wrapper script but with my patch from ticket #4916.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/4917#comment:1>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list