You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I use the template, 'reply.py', as a part of my auto-reply bot.
Everything goes well, but when I use the code as follow:
classReplyListener(StreamListener):
defon_notification(self, notification): #listen for notificationsifnotification['type'] =='mention': #if we're mentioned:process_mention(mastodon, notification)
# create a new instance of our ReplyListener classrl=ReplyListener()
mastodon.stream_user(rl) #go!
I got the error:
Traceback (most recent call last):
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\response.py", line 700, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\response.py", line 441, in _error_catcher
yield
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\response.py", line 767, in read_chunked
self._update_chunk_length()
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\response.py", line 704, in _update_chunk_length
raise InvalidChunkLength(self, line)
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\models.py", line 760, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\response.py", line 575, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\response.py", line 796, in read_chunked
self._original_response.close()
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\response.py", line 458, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\mastodon\streaming.py", line 64, in handle_stream
for chunk in response.iter_content(chunk_size = 1):
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\models.py", line 763, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\mastodon\Mastodon.py", line 102, in wrapper
return function(self, *args, **kwargs)
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\mastodon\Mastodon.py", line 3110, in stream_user
return self.__stream('/api/v1/streaming/user', listener, run_async=run_async, timeout=timeout, reconnect_async=reconnect_async, reconnect_async_wait_sec=reconnect_async_wait_sec)
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\mastodon\Mastodon.py", line 3628, in __stream
listener.handle_stream(r)
File "C:\Users\geron\AppData\Local\Programs\Python\Python36\lib\site-packages\mastodon\streaming.py", line 91, in handle_stream
err
File "<string>", line 3, in raise_from
mastodon.Mastodon.MastodonNetworkError: Server ceased communication.
Is it because that the instance configeration of my bot or anything else?
The text was updated successfully, but these errors were encountered:
Hi! I use the template, 'reply.py', as a part of my auto-reply bot.
Everything goes well, but when I use the code as follow:
I got the error:
Is it because that the instance configeration of my bot or anything else?
The text was updated successfully, but these errors were encountered: