ch.py
ch.py copied to clipboard
Hangup in socket.py
Not sure if this is a specific issue for ch.py or if it's a wider issue, but the bot just started to hang up after a while and i had to interrupt it.
Trace:
Traceback (most recent call last):
File "fvbot.py", line 220, in <module>
FVBot.easy_start(["fv-se"], fvbotauth.FVBOT_USER, fvbotauth.FVBOT_PASS, True)
File "C:\Users\Joe\Documents\GitHub\FVBot\ch.py", line 2182, in easy_start
self.main()
File "C:\Users\Joe\Documents\GitHub\FVBot\ch.py", line 2140, in main
rd, wr, sp = select.select(socks, wsocks, [], self._TimerResolution)
File "C:\Python27\lib\socket.py", line 223, in meth
def meth(name,self,*args):
KeyboardInterrupt
i blame chatango and maybe the stdlib
in any case, this isn't a issue cause by ch.py
Yo9u need python 3.3.3 at least to run the python bot. Lol
@LordYusei the original ch.py support python 2 and python 3
the last time i check, this "updated" copy also support python 2 and python3 although someone could have added python 3 only features.
ether way, the last time i check, this copy is a mess and isn't updated anymore so it shouldn't be use.
Hmm, i only ever had luck with python3 with this. Maybe you're just lucky On 26 Aug 2015 14:18, "asl97" [email protected] wrote:
@LordYusei https://github.com/LordYusei the original ch.py support python 2 and python 3
the last time i check, this "updated" copy also support python 2 and python3 although someone could have added python 3 only features.
— Reply to this email directly or view it on GitHub https://github.com/Nullspeaker/ch.py/issues/67#issuecomment-135013522.
@LordYusei you should check the website before replying if possible cause when someone edit their post, github doesn't send any message about the edit.
in any case, this is where python2 compatibility is done, luck has nothing to do with it: https://github.com/Nullspeaker/ch.py/blob/master/ch.py#L52
at best, i blame windows or whatever os for their socket implementation and/or chatango and/or python socket implementation for causing hangup.
So it does. I missed that when i was using it. Lol On 26 Aug 2015 14:24, "asl97" [email protected] wrote:
@LordYusei https://github.com/LordYusei you should check the website before replying if possible cause when someone edit their post, github doesn't send any message about the edit.
in any case, this is where python2 compatibility is done: https://github.com/Nullspeaker/ch.py/blob/master/ch.py#L52
— Reply to this email directly or view it on GitHub https://github.com/Nullspeaker/ch.py/issues/67#issuecomment-135017462.
@JoeStaines If you wanted to make it so you were notified of an error you could do something like this for when the bot errors while running.
if __name__ == "__main__":
error = 0
try:
os.system("clear") # Clears the python console so that if you have info it removes it and starts fresh
TestBot.easy_start(rooms, "Username", "Password")
except KeyboardInterrupt:
print("[ERR] Console initiated a kill.")
except Exception as e:
print("[ERR] Fatal error.")
error = 1
hexc(e)
if error = 1:
print("Waiting 5 seconds to disconnect the operations")
time.sleep(5)
print("Shutting down")
so... is this an issue? XD
@piks Honestly, No idea. In my use of ch.py all I had was errors thrown upon entering the bot in certain chats. It was mainly like chats with large amounts of users joining and leaving rapidly.
From what I can create similar to his issue, It seems to be caused by a function he has created. More than likely it's a function that either runs constantly when executed, or just runs from startup and glitches out the bot. I'm not sure it's something that needs to be looked into for that part but more something that he needs to check his code for.
wrapping the whole bot in a try except
just to capture the error and display it is a flaw method, it's one of the reason why the old botteh code give rubbish errors, just let it error normally.
to see the error without it closing as soon as it error, it should ether be started using the terminal/cmd or as a service with proper message piping.
@LordYusei format your code using markdown next time please, also, hexc doesn't seem to be define.
How can I log as anon instead of user?
@mor0n off-topic, this issue is about hangup in socket.py
@asl97 so where I can ask about it?
@mor0n don't know, don't care. there was never an official support channel or anything.
at best, you would have to find someone who is not only knowledgeable about the library itself (and maybe the chatango protocol if something has change) but also willing to help you with it.
you could try opening an issue but it would still be off-topic if you title it "How can I log as anon instead of user?
" since that would be an question and not a issue.
even if you make it sound more like an issue or even an feature request so it suit the issue tracker more but i doubt people who know about it would bother responding.
the ch.py has long been abandon by the original author and most if not all the current collaborators and contributions.
you should find another better maintain library than the ch.py, maybe one with a support channel (there are some information on others on the unofficial wikia).
Closing due to old age, and no longer supporting python2