tcoppi / scrappy

scrappy is an IRC bot written in python.
Other
3 stars 1 forks source link

Markov misbehaving on fresh installation of scrappy #18

Open PartlyAtomic opened 10 years ago

PartlyAtomic commented 10 years ago

Traceback:

Unhandled exception in thread started by <bound method markov.markov_learn of <markov.markov.markov object at 0x23707d0>>
Traceback (most recent call last):
  File "/home/scrappy/repos/scrappy/modules/markov/markov.py", line 220, in markov_learn
    (" ".join(self.emit_chain(random.choice(event.tokens)))))
  File "/home/scrappy/repos/scrappy/irclib/client.py", line 844, in privmsg
    self.send_raw("PRIVMSG %s :%s" % (target, text))
  File "/home/scrappy/repos/scrappy/irclib/client.py", line 866, in send_raw
    "Carriage returns not allowed in privmsg(text)")
irclib.client.InvalidCharacters: Carriage returns not allowed in privmsg(text)
mharrison commented 10 years ago

Oct 09, 2013 17:41:12 <[mharrison]> y", line 866, in send_raw Oct 09, 2013 17:41:12 <[mharrison]> "Carriage returns not allowed in privmsg(text)") Oct 09, 2013 17:41:12 <[mharrison]> irclib.client.InvalidCharacters: Carriage returns not allowed in privmsg(text) Oct 09, 2013 17:41:13 <[mharrison]> WAT Oct 09, 2013 17:41:45 UHOH Oct 09, 2013 17:41:48 YOU ANGERED It REDACTED REDACTED Oct 09, 2013 17:42:24 <[mharrison]> wait a REDACTED minute REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED Oct 09, 2013 17:45:26 <[mharrison]> $mkdump wat Oct 09, 2013 17:45:27 Done taking a REDACTED. Oct 09, 2013 17:46:16 <[mharrison]> scrapoo, just nuke Oct 09, 2013 17:46:29 <[mharrison]> scrapoo, nuke Oct 09, 2013 17:46:33 <[mharrison]> scrapoo, nuke Oct 09, 2013 17:46:33 <[mharrison]> scrapoo, nuke Oct 09, 2013 17:46:33 <[mharrison]> scrapoo, nuke Oct 09, 2013 17:46:51 <[mharrison]> Unhandled exception in thread started by <bound method markov.markov_learn of <markov.markov.markov object at 0x101335890>> Oct 09, 2013 17:46:51 <[mharrison]> Traceback (most recent call last): Oct 09, 2013 17:46:51 <[mharrison]> File "/Users/mharrison/Dev/python/scrappy/scrappylando/scrappy/modules/markov/markov.py", line 213, in markov_learn Oct 09, 2013 17:46:51 <[mharrison]> c.privmsg(event.target, "%s: %s" % (event.source.nick, " ".join(tmp))) Oct 09, 2013 17:46:51 <[mharrison]> File "/Users/mharrison/Dev/python/scrappy/scrappylando/scrappy/irclib/client.py", line 844, in privmsg Oct 09, 2013 17:46:51 <[mharrison]> self.send_raw("PRIVMSG %s :%s" % (target, text)) Oct 09, 2013 17:46:51 <[mharrison]> File "/Users/mharrison/Dev/python/scrappy/scrappylando/scrappy/irclib/client.py", line 866, in send_raw Oct 09, 2013 17:46:51 <[mharrison]> "Carriage returns not allowed in privmsg(text)") Oct 09, 2013 17:46:51 <[mharrison]> irclib.client.InvalidCharacters: Carriage returns not allowed in privmsg(text) Oct 09, 2013 17:46:53 <[mharrison]> What the REDACTED Oct 09, 2013 17:46:56 <-- scrapoo has quit (Quit: BAIL OUT!!) Oct 09, 2013 17:47:22 sanitize your db! Oct 09, 2013 17:47:34 you've got a carriage return in there somehow Oct 09, 2013 17:47:40 <[mharrison]> FROM YOU Oct 09, 2013 17:48:05 <[mharrison]> BUT IT'S A 10-MINUTE-OLD DB, IT SHOULD NOT ALREADY BE REDACTED REDACTED REDACTED Oct 09, 2013 17:48:41 <[mharrison]> # words = [x.strip() for x in tokens if not x.isspace()] Oct 09, 2013 17:48:46 <[mharrison]> Why is this commented out! Oct 09, 2013 17:49:04 probably made it stupid or something! Oct 09, 2013 17:49:06 what's the git blame on it Oct 09, 2013 17:49:46 all your fault apparently! Oct 09, 2013 17:49:59 lul Oct 09, 2013 17:50:03 <[mharrison]> wat! I barely work on markov! Oct 09, 2013 17:50:15 I just blamed the whole file and it told me you wrote 100%! Oct 09, 2013 17:50:40 <[mharrison]> Whatever's in his db is apparently so REDACTED that it froze firefox when I opened it with my SQLite viewer! Oct 09, 2013 17:50:47 I'm glad we have the REDACTED secret keys on github! Oct 09, 2013 17:51:15 jdrouhard: or just fix scrappy! lul Oct 09, 2013 17:51:25 he's meant to be a lite irc bot Oct 09, 2013 17:51:51 well if he's as bad as you say he is, shouldn't he be scrapped? Oct 09, 2013 17:52:08 nah it's just that module that needs scrapped Oct 09, 2013 17:52:19 well, then i'll scrap scrappy's markov Oct 09, 2013 17:52:19 <[mharrison]> There's a REDACTEDLOAD of whitespace as keys in that DB! Oct 09, 2013 17:52:42 I rewrote how modules work and updated all of the existing modules to work again Oct 09, 2013 17:52:49 and markov got fixed more and slightly broken more Oct 09, 2013 17:53:31 <[mharrison]> https://github.com/tcoppi/scrappy/commit/35c8289624192806f62725330bf3888b0b4f584c#diff-404df71295da7ce3950c610473dce739 Oct 09, 2013 17:53:33 <[mharrison]> RIGHT HERE Oct 09, 2013 17:53:48 <[mharrison]> https://github.com/tcoppi/scrappy/commit/35c8289624192806f62725330bf3888b0b4f584c#diff-404df71295da7ce3950c610473dce739L191 Oct 09, 2013 17:53:54 <[mharrison]> YOU DID THIS Oct 09, 2013 17:54:37 you shouldn't be getting carriage returns from IRC period! Oct 09, 2013 17:55:23 <[mharrison]> https://github.com/tcoppi/scrappy/commit/35c8289624192806f62725330bf3888b0b4f584c#diff-404df71295da7ce3950c610473dce739L237 what's this all about! Oct 09, 2013 17:55:42 what line! Oct 09, 2013 17:55:50 <[mharrison]> It seems as though you went in there, commented out all the error-handling/data sanitizing stuff,and said "THIS IS FINE Oct 09, 2013 17:55:57 <[mharrison]> Line is in link! Oct 09, 2013 17:56:17 it shows one whole thing commented out in that link! Oct 09, 2013 17:56:49 <[mharrison]> 237! It's linked right to it! Oct 09, 2013 17:57:11 yes, I did it differently! Oct 09, 2013 17:57:15 instead of calculating random int every time Oct 09, 2013 17:57:20 I just set it before the loop Oct 09, 2013 17:57:23 for i in range(1, random.randint(5,50)): Oct 09, 2013 17:57:27 vs if i >= random.randint(5, 50): Oct 09, 2013 17:57:51 that's got nothing to do with error handling or data sanitizing, so you'd better check your privilege at the door! REDACTED Oct 09, 2013 18:01:16 <[mharrison]> You changed a few '().append(x)' statements to '[] += x' too!

On 12/2/13 2:07 AM, Landon Fowles wrote:

Traceback:

Unhandled exception in thread started by > Traceback (most recent call last): File "/home/scrappy/repos/scrappy/modules/markov/markov.py", line 220, in markov_learn (" ".join(self.emit_chain(random.choice(event.tokens))))) File "/home/scrappy/repos/scrappy/irclib/client.py", line 844, in privmsg self.send_raw("PRIVMSG %s :%s" % (target, text)) File "/home/scrappy/repos/scrappy/irclib/client.py", line 866, in send_raw "Carriage returns not allowed in privmsg(text)") irclib.client.InvalidCharacters: Carriage returns not allowed in privmsg(text)

— Reply to this email directly or view it on GitHub https://github.com/tcoppi/scrappy/issues/18.

mharrison commented 10 years ago

REDACTED