{"action":"created","issue":{"url":"https://api.github.com/repos/nickoala/telepot/issues/87","repository_url":"https://api.github.com/repos/nickoala/telepot","labels_url":"https://api.github.com/repos/nickoala/telepot/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/nickoala/telepot/issues/87/comments","events_url":"https://api.github.com/repos/nickoala/telepot/issues/87/events","html_url":"https://github.com/nickoala/telepot/issues/87","id":156173400,"number":87,"title":"Connection reset by peer","user":{"login":"feranto63","id":16478400,"avatar_url":"https://avatars.githubusercontent.com/u/16478400?v=3","gravatar_id":"","url":"https://api.github.com/users/feranto63","html_url":"https://github.com/feranto63","followers_url":"https://api.github.com/users/feranto63/followers","following_url":"https://api.github.com/users/feranto63/following{/other_user}","gists_url":"https://api.github.com/users/feranto63/gists{/gist_id}","starred_url":"https://api.github.com/users/feranto63/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feranto63/subscriptions","organizations_url":"https://api.github.com/users/feranto63/orgs","repos_url":"https://api.github.com/users/feranto63/repos","events_url":"https://api.github.com/users/feranto63/events{/privacy}","received_events_url":"https://api.github.com/users/feranto63/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nickoala/telepot/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":34,"created_at":"2016-05-22T21:15:46Z","updated_at":"2016-07-26T19:53:49Z","closed_at":null,"body":"since I upgrade to telepot 8.0 I got this error when calling a normal bot.sendMessage.\r\n\r\nThis is an extract of the code that caused the error. Just to say that never occurred with telepot 6 or 7.\r\nThe error occours if only the program is running since some minutes, the error does not occour if the program has been started very recently.\r\nPlease help me.\r\n\r\n`        try:\r\n            n=persona.index(nome)\r\n        except ValueError: #non ho riconosciuto la persona\r\n            bot.sendMessage(CHAT_ID, \"Padrone verifica se ci sono sconosciuti in casa!\")\r\n            return\r\n        \r\n        if status == 'IN':\r\n            if persona_at_home[n] == False:\r\n                persona_at_home[n] = True\r\n                messaggio_IN=\"Benvenuto a casa \"+nome+\"\\nSono le \"+ora_minuti\r\n                bot.sendMessage(CHAT_ID, messaggio_IN ,disable_notification=hide_notify)\r\n                f = open(persona[n]+\"_at_home\",\"w\")  #apre il file dei dati in write mode, se il file non esiste lo crea\r\n                f.write(\"IN\")  #scrive la info di presence sul file\r\n                f.close()  #chiude il file dei dati e lo salva\r\n        elif status == 'OUT':\r\n            if persona_at_home[n]:\r\n                persona_at_home[n] = False\r\n                messaggio_OUT=\"Arrivederci a presto \"+nome+\"\\nSono le \"+ora_minuti\r\n                bot.sendMessage(CHAT_ID, messaggio_OUT ,disable_notification=hide_notify)\r\n                f = open(persona[n]+\"_at_home\",\"w\")  #apre il file dei dati in write mode, se il file non esiste lo crea\r\n                f.write(\"OUT\")  #scrive la info di presence sul file\r\n                f.close()  #chiude il file dei dati e lo salva\r\n`\r\n\r\nTraceback\r\n (most recent call last):\r\n  File \"/home/pi/git/thermostat/thermostat/thermogram2.py\", line 825, in <module>\r\n    check_presence_IP() # controlla la presente con ping IP\r\n  File \"/home/pi/git/thermostat/thermostat/thermogram2.py\", line 561, in check_presence_IP\r\n    set_presence(persona[n]+' IN') #richiama la funzione per la gestisce della presence\r\n  File \"/home/pi/git/thermostat/thermostat/thermogram2.py\", line 505, in set_presence\r\n    bot.sendMessage(CHAT_ID, messaggio_IN ,disable_notification=hide_notify)\r\n  File \"/usr/local/lib/python2.7/dist-packages/telepot/__init__.py\", line 176, in sendMessage\r\n    return self._api_request('sendMessage', _rectify(p))\r\n  File \"/usr/local/lib/python2.7/dist-packages/telepot/__init__.py\", line 167, in _api_request\r\n    return api.request((self._token, method, params, files), **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/telepot/api.py\", line 126, in request\r\n    r = fn(*args, **kwargs)  # `fn` must be thread-safe\r\n  File \"/usr/local/lib/python2.7/dist-packages/urllib3/request.py\", line 151, in request_encode_body\r\n    return self.urlopen(method, url, **extra_kw)\r\n  File \"/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py\", line 165, in urlopen\r\n    response = conn.urlopen(method, u.request_uri, **kw)\r\n  File \"/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py\", line 623, in urlopen\r\n    _stacktrace=sys.exc_info()[2])\r\n  File \"/usr/local/lib/python2.7/dist-packages/urllib3/util/retry.py\", line 232, in increment\r\n    raise six.reraise(type(error), error, _stacktrace)\r\n  File \"/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py\", line 578, in urlopen\r\n    chunked=chunked)\r\n  File \"/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py\", line 385, in _make_request\r\n    httplib_response = conn.getresponse(buffering=True)\r\n  File \"/usr/lib/python2.7/httplib.py\", line 1073, in getresponse\r\n    response.begin()\r\n  File \"/usr/lib/python2.7/httplib.py\", line 415, in begin\r\n    version, status, reason = self._read_status()\r\n  File \"/usr/lib/python2.7/httplib.py\", line 371, in _read_status\r\n    line = self.fp.readline(_MAXLINE + 1)\r\n  File \"/usr/lib/python2.7/socket.py\", line 476, in readline\r\n    data = self._sock.recv(self._rbufsize)\r\n  File \"/usr/lib/python2.7/ssl.py\", line 714, in recv\r\n    return self.read(buflen)\r\n  File \"/usr/lib/python2.7/ssl.py\", line 608, in read\r\n    v = self._sslobj.read(len or 1024)\r\nurllib3.exceptions.ProtocolError: ('Connection aborted.', error(104, 'Connection reset by peer'))\r\n"},"comment":{"url":"https://api.github.com/repos/nickoala/telepot/issues/comments/235384851","html_url":"https://github.com/nickoala/telepot/issues/87#issuecomment-235384851","issue_url":"https://api.github.com/repos/nickoala/telepot/issues/87","id":235384851,"user":{"login":"feranto63","id":16478400,"avatar_url":"https://avatars.githubusercontent.com/u/16478400?v=3","gravatar_id":"","url":"https://api.github.com/users/feranto63","html_url":"https://github.com/feranto63","followers_url":"https://api.github.com/users/feranto63/followers","following_url":"https://api.github.com/users/feranto63/following{/other_user}","gists_url":"https://api.github.com/users/feranto63/gists{/gist_id}","starred_url":"https://api.github.com/users/feranto63/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feranto63/subscriptions","organizations_url":"https://api.github.com/users/feranto63/orgs","repos_url":"https://api.github.com/users/feranto63/repos","events_url":"https://api.github.com/users/feranto63/events{/privacy}","received_events_url":"https://api.github.com/users/feranto63/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T19:53:49Z","updated_at":"2016-07-26T19:53:49Z","body":"@nickoala I'm trying your suggestion #1 since 2 hours and it seems to solve the problem with retries = 3. I will test it a couple of days and I will return results. \r\n"}}
{"actor":{"display_login":"feranto63"}}