python文件运行一段时间后失效_python项目出错,隔一段时间就会异常,各位过来看下怎么解决。。。...

[29 17:21:42]: call_request ERROR 处理异常: Traceback (most recent call last):

File "/server/pstn_proxy/call_request.py", line 50, in mainProc

commanderMap[command](channel_no, command, content)

File "/server/pstn_proxy/sm.py", line 333, in request

request_person(netx_channel, command, req)

File "/server/pstn_proxy/sm.py", line 545, in request_person

subcode, a, b = sm_subcode.get_subcode(req['uid'], '0001', req['phonenum'], 1, 1)

File "/server/pstn_proxy/sm_subcode.py", line 57, in get_subcode

cs.execute("SELECT subcode, identifier FROM subcode WHERE pvdcode = '%s' AND phone = '%s'" %(pvdcode, phone))

File "/usr/local/lib/python2.5/site-packages/DBUtils-0.9.4-py2.5.egg/DBUtils/SteadyDB.py", line 335, in tough_method

result = method(*args, **kwargs) # try to execute

File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line 147, in execute

charset = db.character_set_name()

InterfaceError: (0, '')

google搜索的结果是:

Try passing the cursor and not the connection -

import MySQLdb

import module_name

connection = MySQLdb.connect(host='localhost', user='user',

passwd='password', db='database')

cursor = connection.cursor()

module = module_name.ClassName(cursor)

但是项目里面的数据库连接部分大概是这样的:

from DBUtils.PersistentDB import PersistentDB

persist = PersistentDB(creator=dbdriver,**DSN_DB)

cs = config.persist.connection().cursor(config.persist._creator.cursors.DictCursor)

在线等结果!!!先谢谢!!!

谷歌的链接 http://objectmix.com/python/17526-re-mysql-interfaceerror.html

作者: youbiyun

发布时间: 2011-07-04

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值