cirospaciari / socketify.py

Bringing Http/Https and WebSockets High Performance servers for PyPy3 and Python3
https://www.socketify.dev
MIT License
1.44k stars 56 forks source link

Can't create an ASGI server with default `options` on v0.0.29: `object has no attribute 'cert_file_name'` #200

Closed clementpoiret closed 3 weeks ago

clementpoiret commented 3 weeks ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a dummy app,
  2. ASGI(app=app).listen(8080).run()

Expected behavior As in v0.0.28, everything should work.

Current behavior:

Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    run_app()
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    server = _ASGI(
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
             ^^^^^^
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
Traceback (most recent call last):
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    server = _ASGI(
             ^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
AttributeError: 'function' object has no attribute 'cert_file_name'
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 845, in run
    run_task()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
Traceback (most recent call last):
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 20, in <module>
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
    run_app()
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/main.py", line 17, in run_app
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
    ASGI(app=app, options=None).listen(8080).run(workers=int(workers))
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 852, in run
    run_task()  # run app on the main process too :)
    ^^^^^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 824, in run_task
    server = _ASGI(
             ^^^^^^
  File "/mnt/hdd/Sync/Projects/Caminov/Fringuant/api_next/.devenv/state/venv/lib/python3.12/site-packages/socketify/asgi.py", line 576, in __init__
    self.SERVER_SCHEME = "https" if self.server.options and self.server.options.cert_file_name is not None else "http"
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'cert_file_name'
cirospaciari commented 3 weeks ago

Sorry for the regression.

Fixed by https://github.com/cirospaciari/socketify.py/commit/d73ed582d5d4b111c673051b5b8256d2d9eab70b v0.0.30 is available now with the fix

clementpoiret commented 3 weeks ago

Awesome, thanks for your reactivity 👌

glanzel commented 2 weeks ago

There ist an similar problem in wsgi.py in line 674 "wsgi.url_scheme": "https" if self.server.options and self.server.options.cert_file_name is not None else "http"

cirospaciari commented 2 weeks ago

There ist an similar problem in wsgi.py in line 674 "wsgi.url_scheme": "https" if self.server.options and self.server.options.cert_file_name is not None else "http"

looks like I will do another release today to fix it thanks for reporting

EDIT new release available