Can you fix indentation please?
Actually i am mot sure if it happens on my side only but i am getting stuff like mixed tabs and spaces..
Example:
What is supposed to be:
Code: Select all
for s in list(self.clients.keys()):
if s.fileno() == fd[0]:
newsocket = s
iR.append(newsocket)
Shows up as:
Code: Select all
for s in list(self.clients.keys()):
if s.fileno() == fd[0]:
newsocket = s
iR.append(newsocket)
and fails with some variable newsocket referenced before assignment error
Also i was getting crashes in Main.run on:
(stuff like getting different random errors every time)
Code: Select all
self.database.query("SELECT name,founder,operators,accountmutes,topic,password,id,ipmutes,accountbans,ipbans FROM channels")
res = self.database.store_result()
I tried
Code: Select all
db = mysql.connect("localhost", "root", "passwordpassword", "pytasserver")
mysql.query("SELECT name,founder,operators,accountmutes,topic,password,id,ipmutes,accountbans,ipbans FROM channels")
ret = mysql.store_result()
which succeeded every time.
I was raging/messing around a while then i noticed
Code: Select all
thread.start_new_thread(self.connectionpingthread,())
connectionpingthread then calls sd.ping.
Unlike the other methods query and store_result where you mess with synchronisation by lock.acquire/release the ping method has none.
After commenting out the start_new_thread call everything magically worked fine..
Is it possible that there is some weird race condition whatever thing going on?