A
A
ayb2014-03-25 20:54:10
Python
ayb, 2014-03-25 20:54:10

Python asynchronous - how to fix the error?

There is a simple server that receives data from the client, and depending on which line it receives, performs different actions ( link to pastebin ).
The server performs its functions, but with any access to it, it writes to the console:

error: uncaptured python exception, closing channel <__main__.EchoHandler 37.55.139.97:50573 at 0xb738bc4c> (:tuple index out of range [/usr/lib/python3.3/asyncore.py|read|83] [/usr/lib /python3.3/asyncore.py|handle_read_event|441] [./srv.py|handle_read|19])

What does this actually mean, and how to get rid of it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Dugin, 2014-03-25
@ayb

Written: tuple index out of range
Accessed a tuple by an index that does not exist in it.
Probably somewhere here:
setData = query.split(' ')
setQuerry = tuple(setData)
querySet = (setQuerry[0],setQuerry[1],setQuerry[2],setQuerry[3],setQuerry[4])
What to do?
1) Beat the ruler on the hands until you learn how to check the necessary conditions.
2) Learn Python's syntax and the standard library so you don't have to write shitty code like the three lines above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question