[mythtv-commits] Ticket #8917: Jamu script crashes in dutch locale

MythTV mythtv at cvs.mythtv.org
Sat Sep 11 22:25:52 UTC 2010

#8917: Jamu script crashes in dutch locale
     Reporter:  launchpad@…            |       Owner:  robertm
         Type:  defect                 |      Status:  new    
     Priority:  minor                  |   Milestone:  unknown
    Component:  Plugin - MythVideo     |     Version:  0.23.1 
     Severity:  medium                 |    Keywords:  jamu   
Ticket locked:  0                      |  
 I get the following error whenever the jamy.py script is run by a cron

 Traceback (most recent call last):
   File "/usr/share/mythtv/mythvideo/scripts/jamu.py", line 6435, in
 <module> main()
   File "/usr/share/mythtv/mythvideo/scripts/jamu.py", line 6420, in main
   File "/usr/share/mythtv/mythvideo/scripts/jamu.py", line 5588, in
   File "/usr/share/mythtv/mythvideo/scripts/jamu.py", line 5235, in
     programs = self._getScheduledRecordedProgramList()
   File "/usr/share/mythtv/mythvideo/scripts/jamu.py", line 5051, in
     recordedlist = MythBE(backend=mythbeconn.hostname,
   File "/usr/lib/python2.6/site-packages/MythTV/MythFunc.py", line 325, in
     + PROGRAM_FIELDS], db=self.db))
   File "/usr/lib/python2.6/site-packages/MythTV/MythData.py", line 444, in
     DictData.__init__(self, raw)
   File "/usr/lib/python2.6/site-packages/MythTV/MythBase.py", line 166, in
   File "/usr/lib/python2.6/site-packages/MythTV/MythBase.py", line 178, in
 _process data[i] = locale.atof(data[i])
   File "/usr/lib/python2.6/locale.py", line 292, in atof
     return func(string)
 ValueError: invalid literal for float(): 0,000000

 I managed to solve this by exporting a locale in the mythvideo cron

 #Hourly massive update to ensure users see graphics coming in for upcoming
 recordings and current recordings
 DIRECTORY=$(grep ^mythtv /etc/passwd | awk -F : '{print $6}')
 if [ -f "$DIRECTORY/.mythtv/config.xml" ]; then
     su mythtv -c "export locale=nl_NL.UTF-8; /usr/bin/python
 /usr/share/mythtv/mythvideo/scripts/jamu.py -MW >>
 #    su mythtv -c "/home/mythtv/jamu >> '/var/log/mythtv/jamu.log'"

 In addition, I had to insert a call to locale.resetlocale() into the
 main() method of jamu.py:

 def main():
     """Support jamu from the command line
     returns True

     parser = OptionParser(usage=u"%prog usage: jamu
 -hbueviflstdnmoCRFUDSGN [parameters]\n <series name/SID or 'series/SID and
 season number' or 'series/SID and season number and episode number' or
 'series/SID and episode name' or video file/directory paired with
 destination directory'>")

 I'm not a python expert, so maybe there are better ways to solve the
 problem. But maybe you can use this.



Ticket URL: <http://svn.mythtv.org/trac/ticket/8917>
MythTV <http://www.mythtv.org/>
MythTV Media Center

More information about the mythtv-commits mailing list