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

missing icon file causing crashes #42

Open
jonorthwash opened this issue Feb 24, 2025 · 1 comment
Open

missing icon file causing crashes #42

jonorthwash opened this issue Feb 24, 2025 · 1 comment

Comments

@jonorthwash
Copy link
Member

This is using regtest version 0.9.2+g73e42f016-2sid1.

127.0.0.1 - - [24/Feb/2025 11:45:29] "GET /favicon.ico HTTP/1.1" 404 -
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 59316)
Traceback (most recent call last):
  File "/usr/lib/python3.13/http/server.py", line 731, in send_head
    f = open(path, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/apertium-regtest/static/favicon.ico'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.13/socketserver.py", line 697, in process_request_thread
    self.finish_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/socketserver.py", line 362, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/apertium-regtest", line 719, in __init__
    super().__init__(request, client_address, server, directory=directory)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/http/server.py", line 672, in __init__
    super().__init__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/socketserver.py", line 766, in __init__
    self.handle()
    ~~~~~~~~~~~^^
  File "/usr/lib/python3.13/http/server.py", line 436, in handle
    self.handle_one_request()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/http/server.py", line 424, in handle_one_request
    method()
    ~~~~~~^^
  File "/usr/bin/apertium-regtest", line 724, in do_GET
    return super().do_GET()
           ~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/http/server.py", line 676, in do_GET
    f = self.send_head()
  File "/usr/lib/python3.13/http/server.py", line 733, in send_head
    self.send_error(HTTPStatus.NOT_FOUND, "File not found")
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/http/server.py", line 491, in send_error
    self.wfile.write(body)
    ~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/socketserver.py", line 845, in write
    self._sock.sendall(b)
    ~~~~~~~~~~~~~~~~~~^^^
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
@TinoDidriksen
Copy link
Member

https://docs.python.org/3/library/http.server.html#http.server.SimpleHTTPRequestHandler.do_GET - "If the request was mapped to a file, it is opened. Any OSError exception in opening the requested file is mapped to a 404, 'File not found' error."

So that sounds more like a Python 3.13 bug? It should handle 404's gracefully.

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

No branches or pull requests

2 participants