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

TypeError Caused by Missing recursive_guard with Python 3.12.8 #148

Open
nozzy123nozzy opened this issue Dec 30, 2024 · 0 comments
Open

Comments

@nozzy123nozzy
Copy link

Dear Maintener,

While attempting to invoke the ton-http-api, I encountered the following error:

$ ~/.local/bin/ton-http-api --liteserver-config /home/myself/myLocalTon/genesis/db/my-ton-global.config.json --port 8081

Traceback (most recent call last):
  File "/home/myself/.local/bin/ton-http-api", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "...mylocalton/.venv/lib/python3.12/site-packages/pyTON/__main__.py", line 63, in main
    from pyTON.main import app
  File "...mylocalton/.venv/lib/python3.12/site-packages/pyTON/main.py", line 16, in <module>
    from fastapi import FastAPI, Depends, Response, Request, BackgroundTasks
  File "...mylocalton/.venv/lib/python3.12/site-packages/fastapi/__init__.py", line 7, in <module>
    from .applications import FastAPI as FastAPI
...snip...
  File "...mylocalton/.venv/lib/python3.12/site-packages/pydantic/typing.py", line 520, in update_field_forward_refs
    field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...mylocalton/.venv/lib/python3.12/site-packages/pydantic/typing.py", line 66, in evaluate_forwardref
    return cast(Any, type_)._evaluate(globalns, localns, set())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

My environment was:

  • Python 3.12.8
  • ton-http-api 2.0.47, which was installed using pip3 install ton-http-api
  • MyLocalTon v124

The root cause of this problem was related to pydantic. Fortunately, this issue has been resolved in pydantic version 2.7.4. Given this update, I kindly request that the ton-http-api be modified to depend on the latest versions of fastapi and pydantic, or at the very least, ensure that it requires pydantic version 2.7.4 or higher.

I would appreciate it if this problem could be resolved.

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