[mythtv-users] I've probably broken the Python bindings, scripts fail on exceptions.KeyError
Rafael Moslin
rafmoslin at gmail.com
Sun Feb 7 10:56:22 UTC 2010
On 1 February 2010 06:54, Raymond Wagner <raymond at wagnerrp.com> wrote:
>
> On 1/31/2010 19:07, Rafael Moslin wrote:
>>
>> Just before replying I thought it wise to update again so I am now at 23413, however still the same error. Think I'll just have to give up on this for now and wait to see if the maturing of the new bindings code helps or if any others have the same problem.
>
> Having no idea why that error is popping up, I've decided to just remove that whole chunk of code, and re-implement connection caching using weakrefs, which allow the garbage collector to close connections on its own. See if r23419 or later has the same issue.
> _______________________________________________
Sorry for resurrecting this thread but it has been awhile before I
could try the later build, installing a 7km wireless bridge up in one
of our Scottish nature reserves has kept me busy all week.
So, updated this morning to 23499 and there has been a change, now
Jamu reports that the Python bindings can not be imported rather than
erroring per se:
! Warning - Creating an instance caused an error for one of:
MythDBConn or MythVideo, error(function takes exactly 0 arguments (1
given))
! Warning - MythTV python bindings could not be imported,
error(function takes exactly 0 arguments (1 given))
With no other reporters one can only assume that the problem is
definitely with my configuration but I have no idea what could be
broken or where to go looking. As a stab in the dark going interactive
Python with module verbosity on shows the issue as being related to
this error which I have no idea how to debug:
TypeError: function takes exactly 0 arguments (1 given)
This is what is reported when I import MythDB, which appears to the
unenlightened such as myself as quite normal, following section is the
error, and apologies for the length, no idea what is pertinent:
>>> from MythTV import MythDB
import MythTV # directory /usr/lib/python2.5/site-packages/MythTV
# /usr/lib/python2.5/site-packages/MythTV/__init__.pyc matches
/usr/lib/python2.5/site-packages/MythTV/__init__.py
import MythTV # precompiled from
/usr/lib/python2.5/site-packages/MythTV/__init__.pyc
# /usr/lib/python2.5/site-packages/MythTV/MythStatic.pyc matches
/usr/lib/python2.5/site-packages/MythTV/MythStatic.py
import MythTV.MythStatic # precompiled from
/usr/lib/python2.5/site-packages/MythTV/MythStatic.pyc
# /usr/lib/python2.5/site-packages/MythTV/MythBase.pyc matches
/usr/lib/python2.5/site-packages/MythTV/MythBase.py
import MythTV.MythBase # precompiled from
/usr/lib/python2.5/site-packages/MythTV/MythBase.pyc
# /usr/lib/python2.5/re.pyc matches /usr/lib/python2.5/re.py
import re # precompiled from /usr/lib/python2.5/re.pyc
# /usr/lib/python2.5/sre_compile.pyc matches
/usr/lib/python2.5/sre_compile.py
import sre_compile # precompiled from
/usr/lib/python2.5/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.5/sre_constants.pyc matches
/usr/lib/python2.5/sre_constants.py
import sre_constants # precompiled from
/usr/lib/python2.5/sre_constants.pyc
# /usr/lib/python2.5/sre_parse.pyc matches
/usr/lib/python2.5/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.5/sre_parse.pyc
# /usr/lib/python2.5/socket.pyc matches /usr/lib/python2.5/socket.py
import socket # precompiled from /usr/lib/python2.5/socket.pyc
dlopen("/usr/lib/python2.5/lib-dynload/_socket.so", 2);
import _socket # dynamically loaded from
/usr/lib/python2.5/lib-dynload/_socket.so
dlopen("/usr/lib/python2.5/lib-dynload/_ssl.so", 2);
import _ssl # dynamically loaded from
/usr/lib/python2.5/lib-dynload/_ssl.so
import MySQLdb # directory /usr/lib/python2.5/site-packages/MySQLdb
# /usr/lib/python2.5/site-packages/MySQLdb/__init__.pyc matches
/usr/lib/python2.5/site-packages/MySQLdb/__init__.py
import MySQLdb # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/__init__.pyc
# /usr/lib/python2.5/site-packages/MySQLdb/release.pyc matches
/usr/lib/python2.5/site-packages/MySQLdb/release.py
import MySQLdb.release # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/release.pyc
dlopen("/usr/lib/python2.5/site-packages/_mysql.so", 2);
# /usr/lib/python2.5/site-packages/_mysql_exceptions.pyc matches
/usr/lib/python2.5/site-packages/_mysql_exceptions.py
import _mysql_exceptions # precompiled from
/usr/lib/python2.5/site-packages/_mysql_exceptions.pyc
import _mysql # dynamically loaded from
/usr/lib/python2.5/site-packages/_mysql.so
import MySQLdb.constants # directory
/usr/lib/python2.5/site-packages/MySQLdb/constants
# /usr/lib/python2.5/site-packages/MySQLdb/constants/__init__.pyc
matches /usr/lib/python2.5/site-packages/MySQLdb/constants/__init__.py
import MySQLdb.constants # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/constants/__init__.pyc
# /usr/lib/python2.5/site-packages/MySQLdb/constants/FIELD_TYPE.pyc
matches /usr/lib/python2.5/site-packages/MySQLdb/constants/FIELD_TYPE.py
import MySQLdb.constants.FIELD_TYPE # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/constants/FIELD_TYPE.pyc
# /usr/lib/python2.5/site-packages/MySQLdb/times.pyc matches
/usr/lib/python2.5/site-packages/MySQLdb/times.py
import MySQLdb.times # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/times.pyc
dlopen("/usr/lib/python2.5/lib-dynload/time.so", 2);
import time # dynamically loaded from
/usr/lib/python2.5/lib-dynload/time.so
dlopen("/usr/lib/python2.5/lib-dynload/datetime.so", 2);
import datetime # dynamically loaded from
/usr/lib/python2.5/lib-dynload/datetime.so
# /usr/lib/python2.5/sets.pyc matches /usr/lib/python2.5/sets.py
import sets # precompiled from /usr/lib/python2.5/sets.pyc
# /usr/lib/python2.5/__future__.pyc matches
/usr/lib/python2.5/__future__.py
import __future__ # precompiled from /usr/lib/python2.5/__future__.pyc
dlopen("/usr/lib/python2.5/lib-dynload/itertools.so", 2);
import itertools # dynamically loaded from
/usr/lib/python2.5/lib-dynload/itertools.so
# /usr/lib/python2.5/site-packages/MySQLdb/cursors.pyc matches
/usr/lib/python2.5/site-packages/MySQLdb/cursors.py
import MySQLdb.cursors # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/cursors.pyc
# /usr/lib/python2.5/locale.pyc matches /usr/lib/python2.5/locale.py
import locale # precompiled from /usr/lib/python2.5/locale.pyc
dlopen("/usr/lib/python2.5/lib-dynload/_locale.so", 2);
import _locale # dynamically loaded from
/usr/lib/python2.5/lib-dynload/_locale.so
dlopen("/usr/lib/python2.5/lib-dynload/operator.so", 2);
import operator # dynamically loaded from
/usr/lib/python2.5/lib-dynload/operator.so
# /usr/lib/python2.5/weakref.pyc matches /usr/lib/python2.5/weakref.py
import weakref # precompiled from /usr/lib/python2.5/weakref.pyc
dlopen("/usr/lib/python2.5/lib-dynload/_weakref.so", 2);
import _weakref # dynamically loaded from
/usr/lib/python2.5/lib-dynload/_weakref.so
import xml # directory /usr/lib/python2.5/xml
# /usr/lib/python2.5/xml/__init__.pyc matches
/usr/lib/python2.5/xml/__init__.py
import xml # precompiled from /usr/lib/python2.5/xml/__init__.pyc
import _xmlplus # directory /usr/lib/python2.5/site-packages/_xmlplus
# /usr/lib/python2.5/site-packages/_xmlplus/__init__.pyc matches
/usr/lib/python2.5/site-packages/_xmlplus/__init__.py
import _xmlplus # precompiled from
/usr/lib/python2.5/site-packages/_xmlplus/__init__.pyc
import xml.etree # directory /usr/lib/python2.5/xml/etree
# /usr/lib/python2.5/xml/etree/__init__.pyc matches
/usr/lib/python2.5/xml/etree/__init__.py
import xml.etree # precompiled from
/usr/lib/python2.5/xml/etree/__init__.pyc
# /usr/lib/python2.5/xml/etree/cElementTree.pyc matches
/usr/lib/python2.5/xml/etree/cElementTree.py
import xml.etree.cElementTree # precompiled from
/usr/lib/python2.5/xml/etree/cElementTree.pyc
dlopen("/usr/lib/python2.5/lib-dynload/_elementtree.so", 2);
# /usr/lib/python2.5/copy.pyc matches /usr/lib/python2.5/copy.py
import copy # precompiled from /usr/lib/python2.5/copy.pyc
# /usr/lib/python2.5/xml/etree/ElementTree.pyc matches
/usr/lib/python2.5/xml/etree/ElementTree.py
import xml.etree.ElementTree # precompiled from
/usr/lib/python2.5/xml/etree/ElementTree.pyc
# /usr/lib/python2.5/string.pyc matches /usr/lib/python2.5/string.py
import string # precompiled from /usr/lib/python2.5/string.pyc
dlopen("/usr/lib/python2.5/lib-dynload/strop.so", 2);
import strop # dynamically loaded from
/usr/lib/python2.5/lib-dynload/strop.so
# /usr/lib/python2.5/xml/etree/ElementPath.pyc matches
/usr/lib/python2.5/xml/etree/ElementPath.py
import xml.etree.ElementPath # precompiled from
/usr/lib/python2.5/xml/etree/ElementPath.pyc
dlopen("/usr/lib/python2.5/lib-dynload/array.so", 2);
import array # dynamically loaded from /usr/lib/python2.5/lib-dynload/array.so
dlopen("/usr/lib/python2.5/lib-dynload/pyexpat.so", 2);
import pyexpat # dynamically loaded from
/usr/lib/python2.5/lib-dynload/pyexpat.so
import _elementtree # dynamically loaded from
/usr/lib/python2.5/lib-dynload/_elementtree.so
# /usr/lib/python2.5/urllib.pyc matches /usr/lib/python2.5/urllib.py
import urllib # precompiled from /usr/lib/python2.5/urllib.pyc
# /usr/lib/python2.5/urlparse.pyc matches /usr/lib/python2.5/urlparse.py
import urlparse # precompiled from /usr/lib/python2.5/urlparse.pyc
# /usr/lib/python2.5/subprocess.pyc matches /usr/lib/python2.5/subprocess.py
import subprocess # precompiled from /usr/lib/python2.5/subprocess.pyc
# /usr/lib/python2.5/traceback.pyc matches /usr/lib/python2.5/traceback.py
import traceback # precompiled from /usr/lib/python2.5/traceback.pyc
import gc # builtin
dlopen("/usr/lib/python2.5/lib-dynload/select.so", 2);
import select # dynamically loaded from /usr/lib/python2.5/lib-dynload/select.so
dlopen("/usr/lib/python2.5/lib-dynload/fcntl.so", 2);
import fcntl # dynamically loaded from /usr/lib/python2.5/lib-dynload/fcntl.so
# /usr/lib/python2.5/pickle.pyc matches /usr/lib/python2.5/pickle.py
import pickle # precompiled from /usr/lib/python2.5/pickle.pyc
import marshal # builtin
# /usr/lib/python2.5/struct.pyc matches /usr/lib/python2.5/struct.py
import struct # precompiled from /usr/lib/python2.5/struct.pyc
dlopen("/usr/lib/python2.5/lib-dynload/_struct.so", 2);
import _struct # dynamically loaded from
/usr/lib/python2.5/lib-dynload/_struct.so
dlopen("/usr/lib/python2.5/lib-dynload/binascii.so", 2);
import binascii # dynamically loaded from
/usr/lib/python2.5/lib-dynload/binascii.so
dlopen("/usr/lib/python2.5/lib-dynload/cStringIO.so", 2);
import cStringIO # dynamically loaded from
/usr/lib/python2.5/lib-dynload/cStringIO.so
# /usr/lib/python2.5/site-packages/MythTV/MythData.pyc matches
/usr/lib/python2.5/site-packages/MythTV/MythData.py
import MythTV.MythData # precompiled from
/usr/lib/python2.5/site-packages/MythTV/MythData.pyc
# /usr/lib/python2.5/site-packages/MythTV/MythFunc.pyc matches
/usr/lib/python2.5/site-packages/MythTV/MythFunc.py
import MythTV.MythFunc # precompiled from
/usr/lib/python2.5/site-packages/MythTV/MythFunc.pyc
>>>
And when I try and use:
>>> mythtdb=MythDB()
2010-02-07 10:39:01.000 Python Database Connection: Using connection
settings from /home/galileo/.mythtv/config.xml
# /usr/lib/python2.5/site-packages/MySQLdb/connections.pyc matches
/usr/lib/python2.5/site-packages/MySQLdb/connections.py
import MySQLdb.connections # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/connections.pyc
# /usr/lib/python2.5/site-packages/MySQLdb/constants/CLIENT.pyc
matches /usr/lib/python2.5/site-packages/MySQLdb/constants/CLIENT.py
import MySQLdb.constants.CLIENT # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/constants/CLIENT.pyc
# /usr/lib/python2.5/site-packages/MySQLdb/converters.pyc matches
/usr/lib/python2.5/site-packages/MySQLdb/converters.py
import MySQLdb.converters # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/converters.pyc
# /usr/lib/python2.5/site-packages/MySQLdb/constants/FLAG.pyc matches
/usr/lib/python2.5/site-packages/MySQLdb/constants/FLAG.py
import MySQLdb.constants.FLAG # precompiled from
/usr/lib/python2.5/site-packages/MySQLdb/constants/FLAG.pyc
# /usr/lib/python2.5/decimal.pyc matches /usr/lib/python2.5/decimal.py
import decimal # precompiled from /usr/lib/python2.5/decimal.pyc
# /usr/lib/python2.5/threading.pyc matches /usr/lib/python2.5/threading.py
import threading # precompiled from /usr/lib/python2.5/threading.pyc
import thread # builtin
dlopen("/usr/lib/python2.5/lib-dynload/collections.so", 2);
import collections # dynamically loaded from
/usr/lib/python2.5/lib-dynload/collections.so
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/MythTV/MythBase.py", line
991, in __init__
self._check_schema('DBSchemaVer',SCHEMA_VERSION)
File "/usr/lib/python2.5/site-packages/MythTV/MythBase.py", line
1074, in _check_schema
c = self.cursor(self.log)
File "/usr/lib/python2.5/site-packages/MythTV/MythBase.py", line
1124, in cursor
return self.db.cursor(log, self.cursorclass)
File "/usr/lib/python2.5/site-packages/MythTV/MythBase.py", line
767, in cursor
self.db.ping(True)
TypeError: function takes exactly 0 arguments (1 given)
More information about the mythtv-users
mailing list