I am trying to run a player.py file and have occasionally been getting
this error.Can someone please help me out here.<br><br><br>Error:::::::::::::::::::::::<br>No
handlers could be found for logger "ZODB.Connection"<br>
Traceback (most recent call last):<br> File "C:\Documents and
Settings\Arpit\workspace\<div id=":50" class="ii gt">IndianPremierLeagu\src\root\Classes\Player.py",
line 114, in <module><br> if not root.has_key("Players"):<br>
File "D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\Connection.py",
line 811, in setstate<br> self._setstate(obj)<br> File
"D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\Connection.py",
line 879, in _setstate<br>
self._reader.setGhostState(obj, p)<br> File
"D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\serialize.py",
line 595, in setGhostState<br> state = self.getState(pickle)<br>
File "D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\serialize.py",
line 588, in getState<br>
return unpickler.load()<br> File "D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\serialize.py",
line 479, in _persistent_load<br> return self.load_oid(reference)<br>
File "D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\serialize.py",
line 538, in load_oid<br>
return self._conn.get(oid)<br> File "D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\Connection.py",
line 245, in get<br> obj = self._reader.getGhost(p)<br> File
"D:\python\lib\site-packages\zodb3-3.10.0a1-py2.6-win32.egg\ZODB\serialize.py",
line 576, in getGhost<br>
if issubclass(klass, Broken):<br>TypeError: issubclass() arg 1 must
be a class<br><br><br>Cheers,<br><font color="#888888">Rohit</font></div><br><br><br>This is the code of player.py<br><br>from persistent import Persistent<br>import transaction<br>from root import ZodbConnection<br>import Club<br>
<br>class Player(Persistent):<br> def __init__(self,PlayerID,Name,Age,Wage,Batsman,Bowler,Keeper,Height,Weight,Personality,Stamina,Pace,Strength,Fitnessrating,Agility,Reflexes,Jumping,Compusure,Concentration,Influence,HandlingPressure,InnovativeQuotient,Boldness,Adapatability,Determination,Aggression,Loyalty,Flair,HandlingMedia,Decisions,Motivation,FieldPlacement,FrontFoot,BackFoot,StraightDrive,ReverseSweep,Ondrive,BattingTechinique,BowlingSpeed,SlowerDelivery,ReverseSwing,OutSwing,LegBreak,Armball,Flipper,Length,BowlingTechnique,Catching,Thrwoing,BatAwareness,Stumping,BallCollection,FavouredPersonnel,FavouredTeam,Hook,Pull,Defense,CoverDrive,Sweep,LateCut,Cut,Legglance,BowlAwareness,Bouncer,Yorker,Inswing,Offbreak,Doosra,Googly,Line,Chinaman,FieldAwareness,DirectHits,Diving,Glovework,Movement,Communication,Morale,Fitness):<br>
self.PlayerID=PlayerID<br> self.Name=Name<br> self.Age=Age<br> self.Wage=Wage<br> self.Batsman=Batsman<br> self.Bowler=Bowler<br> self.Keeper=Keeper<br> self.Height=Height<br>
self.Weight=Weight<br> self.Personality=Personality<br> self.Stamina=Stamina<br> self.Pace=Pace<br> self.Strength=Strength<br> self.Fitnessrating=Fitnessrating<br> self.Agility=Agility<br>
self.Reflexes=Reflexes<br> self.Jumping=Jumping<br> self.Compusure=Compusure<br> self.Concentration=Concentration<br> self.Influence=Influence<br> self.HandlingPressure=HandlingPressure<br>
self.InnovativeQuotient=InnovativeQuotient<br> self.Boldness=Boldness<br> self.Adapatability=Adapatability<br> self.Determination=Determination<br> self.Aggression=Aggression<br> self.Loyalty=Loyalty<br>
self.Flair=Flair<br> self.HandlingMedia=HandlingMedia<br> self.Decisions=Decisions<br> self.Motivation=Motivation<br> self.FieldPlacement=FieldPlacement<br> self.FrontFoot=FrontFoot<br>
self.BackFoot=BackFoot<br> self.StraightDrive=StraightDrive<br> self.ReverseSweep=ReverseSweep<br> self.Ondrive=Ondrive<br> self.BattingTechinique=BattingTechinique<br> self.BowlingSpeed=BowlingSpeed<br>
self.SlowerDelivery=SlowerDelivery<br> self.ReverseSwing=ReverseSwing<br> self.OutSwing=OutSwing<br> self.LegBreak=LegBreak<br> self.Armball=Armball<br> self.Flipper=Flipper<br> self.Length=Length<br>
self.BowlingTechnique=BowlingTechnique<br> self.Catching=Catching<br> self.Thrwoing=Thrwoing<br> self.BatAwareness=BatAwareness<br> self.Stumping=Stumping<br> self.BallCollection=BallCollection<br>
self.FavouredPersonnel=FavouredPersonnel<br> self.FavouredTeam=FavouredTeam<br> self.Hook=Hook<br> self.Pull=Pull<br> self.Defense=Defense<br> self.CoverDrive=CoverDrive<br> self.Sweep=Sweep<br>
self.LateCut=LateCut<br> self.Cut=Cut<br> self.Legglance=Legglance<br> self.BowlAwareness=BowlAwareness<br> self.Hook=Hook<br> self.Pull=Pull<br> self.Defense=Defense<br> self.CoverDrive=CoverDrive<br>
self.Sweep=Sweep<br> self.LateCut=LateCut<br> self.Cut=Cut<br> self.Legglance=Legglance<br> self.Bouncer=Bouncer<br> self.Yorker=Yorker<br> self.Inswing=Inswing<br> self.Offbreak=Offbreak<br>
self.Doosra=Doosra<br> self.Googly=Googly<br> self.Line=Line<br> self.Chinaman=Chinaman<br> self.FieldAwareness=FieldAwareness<br> self.DirectHits=DirectHits<br> self.Diving=Diving<br>
self.Glovework=Glovework<br> self.Movement=Movement<br> self.Communication=Communication<br> self.Morale=Morale<br> self.Fitness=Fitness<br> <br><br> def clubs(self):<br> result=[]<br>
for name in self.FavouredTeam:<br> result.append(Club.findclubsbyname(name))<br> return result <br><br> for team in result:<br> print "Player's favourite teams are %s" % team<br>
<br><br><br><br>s=ZodbConnection.open_zodb()<br>root=s[0]<br><br><br><br>if not root.has_key("Players"):<br> root['Players'] = {}<br>PlayerRoot=root["Players"]<br><br><br>def listplayers():<br>
if len(PlayerRoot.values())==0:<br> print "There are no players."<br> print<br> return<br> for player in PlayerRoot.values():<br> print "Name: %s" % player.Name<br> print<br>
print "Owned by %s" % player.Age<br> print<br> print player.FavouredPersonnel<br> print<br> <br><br><br><br><br>def addplayers(PlayerID,Name,Age,Wage,Batsman,Bowler,Keeper,Height,Weight,Personality,Stamina,Pace,Strength,Fitnessrating,Agility,Reflexes,Jumping,Compusure,Concentration,Influence,HandlingPressure,InnovativeQuotient,Boldness,Adapatability,Determination,Aggression,Loyalty,Flair,HandlingMedia,Decisions,Motivation,FieldPlacement,FrontFoot,BackFoot,StraightDrive,ReverseSweep,Ondrive,BattingTechinique,BowlingSpeed,SlowerDelivery,ReverseSwing,OutSwing,LegBreak,Armball,Flipper,Length,BowlingTechnique,Catching,Thrwoing,Awareness,Stumping,BallCollection,FavouredPersonnel,FavouredTeam,Hook,Pull,Defense,CoverDrive,Sweep,LateCut,Cut,Legglance,Bouncer,Yorker,Inswing,Offbreak,Doosra,Googly,Line,Chinaman,DirectHits,Driving,Glovework,Movement,Communication,Morale,Fitness):<br>
if PlayerRoot.has_key(Name):<br> print "This player is already created"<br> return<br> <br> if Name:<br> PlayerRoot[Name]=Player(PlayerID,Name,Age,Wage,Batsman,Bowler,Keeper,Height,Weight,Personality,Stamina,Pace,Strength,Fitnessrating,Agility,Reflexes,Jumping,Compusure,Concentration,Influence,HandlingPressure,InnovativeQuotient,Boldness,Adapatability,Determination,Aggression,Loyalty,Flair,HandlingMedia,Decisions,Motivation,FieldPlacement,FrontFoot,BackFoot,StraightDrive,ReverseSweep,Ondrive,BattingTechinique,BowlingSpeed,SlowerDelivery,ReverseSwing,OutSwing,LegBreak,Armball,Flipper,Length,BowlingTechnique,Catching,Thrwoing,Awareness,Stumping,BallCollection,FavouredPersonnel,FavouredTeam,Hook,Pull,Defense,CoverDrive,Sweep,LateCut,Cut,Legglance,Bouncer,Yorker,Inswing,Offbreak,Doosra,Googly,Line,Chinaman,DirectHits,Driving,Glovework,Movement,Communication,Morale,Fitness)<br>
<br> root['Players']=PlayerRoot<br> transaction.commit()<br> print "Player added"<br> print<br> <br><br><br><br><br><br>if __name__=="__main__":<br> while 1:<br> choice=raw_input("Press 'L' to list players, 'A' to add"<br>
"an player, or 'Q' to quit:")<br> choice=choice.lower()<br> if choice=="l":<br> listplayers()<br> elif choice=='a':<br> ID=input("PlayerID:")<br>
name=raw_input("Name:")<br> age=input("Age:")<br> wage=input("Wage:")<br> batsman=input("Batsman:")<br> bowler=input("Bowler:")<br>
keeper=input("Keeper:")<br> height=input("Height:")<br> weight=input("Weight:")<br> personality=raw_input("Personality:")<br> stamina=input("Stamina:")<br>
pace=input("Pace:")<br> strength=input("Strength:")<br> fitnessrating=input("Fitness:")<br> agility=input("Agility")<br> reflexes=input("Reflexes:")<br>
jumping=input("Jumping:")<br> composure=input("Composure:")<br> concentration=input("Concentration:")<br> influence=input("Influence:")<br>
handling_pressure=input("HandlingPressure:")<br> innovative_quotient=input("InnovativeQuotient:")<br> boldness=input("Boldness:")<br> adaptability=input("Adaptability:")<br>
determination=input("Determination:")<br> aggression=input("Aggression:")<br> loyalty=input("Loyalty:")<br> flair=input("Flair:")<br> handling_media=input("HandlingMedia:")<br>
decisions=input("Decisions:")<br> motivation=input("Motivation:")<br> field_placement=input("FieldPlacement:")<br> frontfoot=input("FrontFoot:")<br>
backfoot=input("Backfoot:")<br> straight_drive=input("StraightDrive:")<br> reverse_sweep=input("ReverseSweep:")<br> ondrive=input("Ondrive:")<br>
batting_technique=input("BattingTechnique:")<br> bowling_speed=input("BowlingSpeed:")<br> slower_delivery=input("Slowerdelivery:")<br> reverse_swing=input("ReverseSwing:")<br>
outswing=input("Outswing:")<br> legBreak=input("LegBreak:")<br> armball=input("Armball:")<br> flipper=input("Flipper:")<br> length=input("Length:")<br>
bowling_technique=input("BowlingTechnique:")<br> catching=input("Catching:")<br> throwing=input("Throwing:")<br> batawareness=input("BatAwareness:")<br>
stumping=input("Stumping:")<br> ballcollection=input("BallCollection:")<br> fav_pers=raw_input('Favoured Personnel: ').split(',')<br> fav_team=raw_input("Favourite Team:").split(',')<br>
<br> hook=input("Hook:")<br> pull=input("Pull:")<br> defense=input("Defense:")<br> cover_drive=input("CoverDrive:")<br> sweep=input("Sweep:")<br>
latecut=input("Latecut:")<br> cut=input("Cut:")<br> legglance=input("Legglance:")<br> bowl_awareness=input("BowlingAwareness:")<br> bouncer=input("Bouncer:")<br>
yorker=input("Yorker")<br> inswing=input("Inswing:")<br> offbreak=input("Offbreak:")<br> doosra=input("Doosra:")<br> googly=input("Googly:")<br>
line=input("Line:")<br> chinaman=input("Chinaman:")<br> field_awareness=input("FielcAwareness:")<br> directhits=input("DirectHits:")<br>
diving=input("Diving:")<br> glovework=input("Glovework:")<br> movement=input("Movement:")<br> communication=input("Communication:")<br> morale=raw_input("Morale:")<br>
fitness=raw_input("Fitness:")<br> <br> <br> addplayers(ID,name,age,wage,batsman,bowler,keeper,height,weight,personality,stamina,pace,strength,fitness,agility,reflexes,jumping,composure,concentration,influence,handling_pressure,innovative_quotient,boldness,adaptability,determination,aggression,loyalty,flair,handling_media,decisions,motivation,field_placement,frontfoot,backfoot,straight_drive,reverse_sweep,ondrive,batting_technique,bowling_speed,slower_delivery,reverse_swing,outswing,legBreak,armball,flipper,length,bowling_technique,catching,throwing,batawareness,stumping,ballcollection,fav_pers,hook,pull,defense,cover_drive,sweep,latecut,cut,legglance,bowl_awareness,bouncer,yorker,inswing,offbreak,doosra,googly,line,chinaman,field_awareness,directhits,diving,glovework,movement,communication,morale,fitness)<br>
<br> <br> elif choice=="q":<br> break <br> <br> <br> <br>ZodbConnection.close_zodb(s) <br><br><br>Its basically a class file.I have tried debugging and have foudn outthat removing this line of code result s in no error.<br>
<br>if not root.has_key("Players"):<br> root['Players'] = {}<br>PlayerRoot=root["Players"]<br><br><br>But i have the same lines of code in another class file in the same module.So i cant understnd why this error occurs.Any help would be much appreciated.<br>
<br>Thanks,<br>Rohit.<br>