[mythtv-commits] Ticket #12520: MythArchive stops after trying to get details from database

MythTV noreply at mythtv.org
Wed Oct 7 07:34:27 UTC 2015

#12520: MythArchive stops after trying to get details from database
     Reporter:  Ben Klopfenstein <benklop@…>  |      Owner:
         Type:  Bug Report - Crash            |     Status:  new
     Priority:  minor                         |  Milestone:  unknown
    Component:  Plugin - MythArchive          |    Version:  Unspecified
     Severity:  medium                        |   Keywords:  backtrace
Ticket locked:  0                             |
 MythArchive's python script, mythburn, fails when running with the
 following backtrace:

 reborn ~ # /usr/share/mythtv/mytharchive/scripts/mythburn.py
 Using simple_fix_rtl
 mythburn.py (0.1.20131119-1) starting up...
 script path:/usr/share/mythtv/mytharchive/scripts
 myth share path:/usr/share/mythtv
 Found 6 CPUs
 Obtaining MythTV settings from MySQL database for hostname MythTV-Frontend
 Traceback (most recent call last):
   File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 5298, in
   File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 5165, in
     defaultsettings = getDefaultParametersFromMythTVDB()
   File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 883, in
     cursor.execute(sqlstatement, configHostname)
   File "/usr/lib64/python2.7/site-packages/MythTV/_conn_mysqldb.py", line
 71, in execute
     raise MythDBError(MythDBError.DB_RAW, e.args)
 MythTV.exceptions.MythDBError: MySQL error: not all arguments converted
 during string formatting

 This seems to be due to string formatting not working correctly for the
 hostname. I have submitted a PR in github with the fix -
 https://github.com/MythTV/mythtv/pull/98 - this allows proper operation,
 at least for me.

 Patch diff (from the PR linked above):
 diff --git a/mythplugins/mytharchive/mythburn/scripts/mythburn.py
 index ccd9861..73b65ec 100755
 --- a/mythplugins/mytharchive/mythburn/scripts/mythburn.py
 +++ b/mythplugins/mytharchive/mythburn/scripts/mythburn.py
 @@ -846,7 +846,7 @@ def getDefaultParametersFromMythTVDB():
 -                    OR (hostname=%s AND value IN(
 +                    OR (hostname='{0}' AND value IN(
 @@ -880,7 +880,7 @@ def getDefaultParametersFromMythTVDB():
      # create a cursor
      cursor = DB.cursor()
      # execute SQL statement
 -    cursor.execute(sqlstatement, configHostname)
 +    cursor.execute(sqlstatement.format(configHostname))
      # get the resultset as a tuple
      result = cursor.fetchall()

Ticket URL: <https://code.mythtv.org/trac/ticket/12520>
MythTV <http://www.mythtv.org>
MythTV Media Center

More information about the mythtv-commits mailing list