rednafi / fastapi-nano

🐍 Simple FastAPI template that mimics Flask's blueprint directory structure
MIT License
895 stars 96 forks source link

make erun local warning bcrypt #314

Closed robomotic closed 1 month ago

robomotic commented 1 month ago

Nice project, when I do: make run-local:

INFO:     Will watch for changes in these directories: ['/home/robomotic/DevOps/github/fastapi-nano']
INFO:     Uvicorn running on http://127.0.0.1:5002 (Press CTRL+C to quit)
INFO:     Started reloader process [32868] using StatReload
INFO:root:Running fastapi-nano with Python 3.13.0 (main, Oct 16 2024, 03:23:02) [Clang 18.1.8 ]
WARNING:passlib.handlers.bcrypt:(trapped) error reading bcrypt version
Traceback (most recent call last):
  File "/home/robomotic/DevOps/github/fastapi-nano/.venv/lib/python3.13/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
    version = _bcrypt.__about__.__version__
              ^^^^^^^^^^^^^^^^^
AttributeError: module 'bcrypt' has no attribute '__about__'
INFO:     Started server process [32870]
INFO:     Waiting for application startup.
INFO:     Application startup complete.

I think is just an issue with that version.

rednafi commented 1 month ago

Thanks for reporting. Yeah, I noticed this. It's an upstream issue that I'll need to take a look.

priamai commented 1 month ago

Temporary fix in the svc/init.py:


import logging
import sys

# Set default logging value to debug
logging.basicConfig(level=logging.INFO)
# disabling due to: https://github.com/pyca/bcrypt/issues/684
logging.getLogger('passlib').setLevel(logging.ERROR)

logging.info("Running service with Python %s", sys.version)
rednafi commented 1 month ago

This has been patched https://github.com/rednafi/fastapi-nano/pull/316