Syntax error in exception handling in is_available
Favagtk flatpak fails to start on my system. The root cause seems to be a syntactic error in is_available:
File "/app/share/favagtk/favagtk/server.py", line 133, in is_available
except e:
^
NameError: name 'e' is not defined
Complete error:
* Serving Flask app 'fava'
* Debug mode: off
Server is now available a URL http://127.0.0.1:57685/.
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:57685
Press CTRL+C to quit
flatpak-spawn: Invalid byte sequence in conversion input
Try "flatpak-spawn --help" for more information.
Exception in thread Thread-1 (wait_loop):
Traceback (most recent call last):
File "/app/share/favagtk/favagtk/server.py", line 127, in is_available
with urllib.request.urlopen(url, timeout=1):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 519, in open
response = self._open(req, data)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open
return self.do_open(http.client.HTTPConnection, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 1352, in do_open
r = h.getresponse()
^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/http/client.py", line 1378, in getresponse
response.begin()
File "/usr/lib/python3.11/http/client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/http/client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/socket.py", line 706, in readinto
return self._sock.recv_into(b)
^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/usr/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/app/share/favagtk/favagtk/server.py", line 107, in wait_loop
if somepredicate(*args, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/share/favagtk/favagtk/server.py", line 133, in is_available
except e:
^
NameError: name 'e' is not defined
Stopping the web server...