aahnik / run-py-bot

A telegram bot that runs python code. Evaluate pythonic expressions on the go, right from your chat.
MIT License
50 stars 36 forks source link

Bot could not Handle certain exponentials #2

Closed aahnik closed 4 years ago

aahnik commented 4 years ago

image

bot got hanged...

Why is the timeout restriction of 10 s not working? no, that should not happen as I have code to handle that

stdout, stderr  =  proc.communicate(timeout=10)

is output too long ?? But I have

if len(returned_val) > 2000:
            returned_val = returned_val[:2000]
            returned_val += '\n\n 😟 Output was too long, truncated to 2000 characters'

Investigate the cause of the problem.

aahnik commented 4 years ago

I now discovered that if the exponential is too large, it times out, but if it is not too large, it gets hanged

IMG_20201031_212036.jpg