Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code updates for Python 3 #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lisbonjoker
Copy link

No description provided.

@lisbonjoker
Copy link
Author

After this changes most from #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

@lisbonjoker
Copy link
Author

Got it running now, but a bit unstable still. Now it's working on Python3.

@lisbonjoker
Copy link
Author

@milesmcc?

@milesmcc
Copy link
Owner

milesmcc commented Jul 8, 2021

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?

@lisbonjoker
Copy link
Author

lisbonjoker commented Jul 8, 2021

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

@lisbonjoker
Copy link
Author

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.

@james-see
Copy link

james-see commented Mar 27, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants