Skip to content

Code updates for Python 3#27

Open
lisbonjoker wants to merge 3 commits into
milesmcc:masterfrom
lisbonjoker:patch-1
Open

Code updates for Python 3#27
lisbonjoker wants to merge 3 commits into
milesmcc:masterfrom
lisbonjoker:patch-1

Conversation

@lisbonjoker

Copy link
Copy Markdown

No description provided.

@lisbonjoker

Copy link
Copy Markdown
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
Copy Markdown
Author

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

@lisbonjoker

Copy link
Copy Markdown
Author

@milesmcc?

@milesmcc

milesmcc commented Jul 8, 2021

Copy link
Copy Markdown
Owner

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

lisbonjoker commented Jul 8, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown
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

james-see commented Mar 27, 2022

Copy link
Copy Markdown

@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.

3 participants