if you look at the plugin code take a look see for a class that is a subclass of asyncore.dispatcher or the likes.. and in the method handle_accept or handle_read see if there are any triggerevent calls inside any of those methods. without it doing an ordinal check an ordinal check would look something like this
Code: Select all
suffix = list(suffix)
for letter in suffix:
if 32 > ord(letter) > 127:
suffix[suffix.index(letter)] = ''
i know 100% the top number is supposed to be 127. i think the bottom is 32 i don't recall honestly. but that will scan a dynamically generated suffix for a character that is outside of "readable" range. meaning it's not A-Z a-z all of your punctuation. so on and so forth. you can also use re and regular expression to do it. so look for that as well. but anything that takes any data received and puts it into an event without any exception handling is a sure fire way to cause this exact problem.
how i would usually code for this would be
Code: Select all
try:
eg.TriggerEvent(suffix)
except:
suffix = list(suffix)
errorHex = []
errorPositions = []
errorSuffix = ''
for i, letter in enumerate(suffix):
if 32 > ord(letter) > 127:
errorPositions.append(str(i))
errorHex.append(hex(letter))
letter = ' '
errorSuffix += letter
errorMessage = 'Received non printable character(s) in the data received.\nData: %s\nPosition(s): %s\nHex Code(s): %s' % (errorSuffix, ', '.join(errorPositions), ', '.join(errorHex))
eg.PrintError(errorMessage)
eg.PrintDebugNotice(errorMessage)
this way it will catch error then scan the suffix and look for the issue, if it finds a character out of sorts then to reformat the suffix removing the problem character and turning it into a hex code that you can use an ASCII char to determine what it is. and also have it send the output to the debug log file that way if you turn on debugging you can just let it do it's thing and look at it later (eg version 0.4 or earlier, debugging does not work properly in 0.5beta)
if you want to KISS it. take the handle_accept method and the handle_read methods and do this and you will get a print out of the actual error
Code: Select all
def handle_read(self, data):
try:
blah blah all the original code. just add the indent to each line.
except:
import traceback
traceback.print_exc()
this will catch any exception. and print it out. without it getting caught by the asyn and the asyn closing the socket on ya and giving you some unrelated message
remember all code here is pseudo code and is for the general idea and not specifically designed to work in this specific problem/plugin. tho it should. besides the usual typo or syntax related problem related to my arthritic code
it looks as tho yours stems from the process_request_thread method. but who knows. you will have to get crosseyed looking at the source for the plugin to know exactly.