Closed senaps closed 5 years ago
okay, I have traced it multiple times, the thing works fine in version 1.5, not in version 2.
I checked the select
function. it's turning args
to a list, log
when used to log the args fails because of the argument being a list instead of string objects. note the argument itself is a tuple, but and instead of having multiple values to be joined, it has one list as it's first argument.
I don't know how it passes the tests, but it shouldn't! :) it's easy to fix for my case, but, this should be thought of and handled properly.
I just added a *
to log function!:)
def log(self, query, args, kwargs):
"""
Log the query and any args or kwargs using C{twisted.python.log.msg} if
C{InteractionBase.LOG} is True.
"""
if not InteractionBase.LOG:
return
log.msg("TWISTAR query: %s" % query)
if len(args) > 0:
if isinstance(args[0], list):
log.msg("TWISTAR args: %s" % ",".join(*args))
else:
log.msg("TWISTAR args: %s" % ",".join(args))
elif len(kwargs) > 0:
log.msg("TWISTAR kargs: %s" % str(kwargs))
Fixed by #77
Hello, our production code failed suddenly with strange error
expected string, list found
so, I traced my data all the way in the code and didn't find out where it's turned to a tuple, and then the logger fails.
I have added this
try/catch
so that the code passes, but! how can I find out why isquery
being turned to a tuple?this is the query that is sent to the log function:
here is how Im using the data:
where
ip
is a string of "192.168.56.31". the funny thing is the code has been running up until now, and I can't get what has changed.I have traced the data as follows:
Currently, my code runs with the following code:
How would I fix this problem permanently? how would I edit the base class using oop? I don't want to run my own fork of the code! (what i am currently doing )