[mythtv-users] python
Jaakko Heikkilä
jaakko.heikkila at gmail.com
Thu May 21 07:38:57 UTC 2015
Hello everyone,
I just happened to have same problem, and I can say that your
configuration file is just fine. There is an error in Python code.
And here is the fix:
File: mythburn.py line: 883
Change line from:
cursor.execute(sqlstatement, configHostname)
to:
cursor.execute(sqlstatement, (configHostname,))
MySQLdb requires that parameters are passed as a sequence:
http://mysql-python.sourceforge.net/MySQLdb.html#some-examples
BR,
Jaska
ke, 2015-02-25 kello 09:32 +0000, Mike Perkins kirjoitti:
> On 25/02/15 02:42, James Linder wrote:
> >
> >> On 25 Feb 2015, at 4:53 am, mythtv-users-request at mythtv.org wrote:
> >>
> >>>>> if anybody has walked this road and has any advice then please ?
> >>>>> I?m trying to build a dvd on my suse backend machine.
> >>>>> After finding a few python modules I got stuck. Clearly python cannot access the DB
> >>
> >>>>> Traceback (most recent call last):
> >>>>> File "/usr/local/share/mythtv/mytharchive/scripts/mythburn.py", line 5298, in <module>
> >>>>> main()
> >>>>> File "/usr/local/share/mythtv/mytharchive/scripts/mythburn.py", line 5165, in main
> >>>>> defaultsettings = getDefaultParametersFromMythTVDB()
> >>>>> File "/usr/local/share/mythtv/mytharchive/scripts/mythburn.py",
> >>>>> line 883, in getDefaultParametersFromMythTVDB
> >>>>> cursor.execute(sqlstatement, configHostname)
> >>>>> File "/usr/lib/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
> >>
> >>>>> Thanks anyone
> >>>>> James
> >>>>> _______________________________________________
> >>
> >>>> The error probably means it's missing a variable.
> >>>> The last line in /_conn_mysqldb.py is an error handler.
> >>>> Line 883 in mythburn.py is the execution of an sql statment. My guess
> >>>> is configHostname is invalid, so look at ~/.mythtv/config.xml for your
> >>>> hostname definition.
> >>
> >>
> >>>> Tot mails,
> >>>> Hika mailto:hikavdh at gmail.com
> >>
> >>> Looked a bit further:
> >>> configHostname = DB.gethostname()
> >>> So maybe an invalid hostname in your database
> >>
> >>> Tot mails,
> >>> Hika Alina Maria van den Hoven mailto:hikavdh at gmail.com
> >>
> >> Just before the exception it logged the query that gave the error.
> >> self.log_query(query, args)
> >> So check the log.
> >
> > Hika thanks for the help, I’m out of my depth with python …
> >
> > Changing the <LocalHostName> results in a new setup for each name (dur!!)
> > This all looks ok for the DB
> >
> > <PingHost>1</PingHost>
> > <Host>192.168.5.35</Host>
> > <UserName>mythtv</UserName>
> > <Password>mythtv</Password>
> > <DatabaseName>mythconverg</DatabaseName>
> > <Port>3306</Port>
> >
> (snip)
> >
> That isn't a hostname, it is an IP address. Whatever you put in that string will
> be used by the backend to generate a profile for the frontend in question.
>
> The usual hostname will be whatever you named the machine when you installed the
> Operating System. Very occasionally this won't be suitable for use by mythtv so
> the 'LocalHostName' can be used to override it.
>
> $ hostname
> skywalker
>
More information about the mythtv-users
mailing list