Code updates for Python 3
After this changes most from https://github.com/milesmcc/LibreNews-Server/issues/26 is fixed except:
ERROR:tornado.application:Uncaught exception GET / (removed)
HTTPServerRequest(protocol='http', host='removed:8888', method='GET', uri='/', version='HTTP/1.1', remote_ip='removed')
Traceback (most recent call last):
File ".local/lib/python3.6/site-packages/tornado/web.py", line 1702, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "webserver.py", line 39, in get
say("Received INDEX request (" + req_resp + ")")
UnboundLocalError: local variable 'req_resp' referenced before assignment
ERROR:tornado.access:500 GET / (removed) 4.67ms
Got it running now, but a bit unstable still. Now it's working on Python3.
@milesmcc?
Hi! Thanks for making these fixes. Happy to merge shortly.
Got it running now, but a bit unstable still. Now it's working on Python3.
Is there anything in particular that's still unstable?
Hi! Thanks for making these fixes. Happy to merge shortly. Hi, glad to be of help. Is there anything in particular that's still unstable?
On entering website:
[LibreNews Server] [ERR] Errored while handling request IP -- still served...
[LibreNews Server] [ERR] Errored while handling request IP -- still served...
[LibreNews Server] [ERR] Errored while handling request IP -- still served...
no exact error shown
when subscribing:
Failed to load resource: the server responded with a status of 500 ()
base.js:96 Uncaught (in promise) Error: Bad status code from server.
at base.js:96
ERROR:tornado.application:Uncaught exception POST /push (127.0.0.1)
HTTPServerRequest(protocol='http', host='librenews.servicosradicais.tech', method='POST', uri='/push', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/home/*/.local/lib/python3.8/site-packages/tornado/web.py", line 1702, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "webserver.py", line 158, in post
say("Receiving new subscription: " + self.request.body)
TypeError: can only concatenate str (not "bytes") to str
ERROR:tornado.access:500 POST /push (127.0.0.1) 99.61ms
ERROR:tornado.application:Uncaught exception POST /push (127.0.0.1)
HTTPServerRequest(protocol='http', host='librenews.servicosradicais.tech', method='POST', uri='/push', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/home/*/.local/lib/python3.8/site-packages/tornado/web.py", line 1702, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "webserver.py", line 158, in post
say("Receiving new subscription: " + self.request.body)
TypeError: can only concatenate str (not "bytes") to str
ERROR:tornado.access:500 POST /push (127.0.0.1) 0.92ms
On a Detected flash
[LibreNews Server] [ERR] Encountered an exception while processing a flash: name 'thread' is not defined
Tornado is not getting the real IPs from nginx and it's getting two errors when a new subscription appears and when a new flash shows up. resulting in not sending browser notifications.
@lisbonjoker looks like you just need to make sure the data send to tornado is wrapped as string not bytes. Prob leftover 2-3 conversion crap. TypeError: can only concatenate str (not "bytes") to str