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

error hypercorn --config python:hypercorn_config.config #244

Open
taogya opened this issue Jun 24, 2024 · 1 comment
Open

error hypercorn --config python:hypercorn_config.config #244

taogya opened this issue Jun 24, 2024 · 1 comment

Comments

@taogya
Copy link

taogya commented Jun 24, 2024

When I run hypercorn --config python:hypercorn_config.config, I get the following error:
(hypercorn --config python:hypercorn_config.config を実行すると次のエラーが出ます。)

  :
  File "/Users/xxxxx/venv/lib/python3.9/site-packages/hypercorn/config.py", line 406, in <dictcomp>
    if not isinstance(getattr(instance, key), types.ModuleType) and not key.startswith("__")
  AttributeError: unreadable attribute

My hypercorn_config.py is the following:
(私のhypercorn_config.py は次のとおりです。)

config = Config()
config.bind = '0.0.0.0:8080'

Here is the result of the debug:
(デバッグした結果は以下の通りです。)

# debug code (breake point to hypercorn/config.py  line 406)
instance.cert_reqs
# debug code result
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: unreadable attribute

I'm not using cert_reqs, do I need to add the expression config.cert_reqs = VerifyMode.CERT_NONE?
(私はcert_reqsを使用しませんが、config.cert_reqs = VerifyMode.CERT_NONEという式を追加しなければなりませんか?)

If there's a smarter way, please let me know.
(もっと賢い方法があれば教えてください。)

@taogya
Copy link
Author

taogya commented Jun 24, 2024

I gave up on loading custom configs with the hypercorn command options, and now I run it with the following asyncio.run(serve(app, config)).
(hypercorn コマンドオプションでカスタムコンフィグをロードするのを諦め、現在は以下のasyncio.run(serve(app, config))にて実行するようにしています。)
https://hypercorn.readthedocs.io/en/latest/how_to_guides/api_usage.html

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

1 participant