-
Notifications
You must be signed in to change notification settings - Fork 141
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
AttributeError: 'NoneType' object has no attribute 'is_using_auth_credentials' #502
Comments
I was able to fix it on my end with this: from safety.auth.cli_utils import build_client_session
client_session, _ = build_client_session()
vulns, db_full = check(session=client_session, packages=packages, ignore_vulns=ignore_vulns) Entanglement with Click did not make this easy to find 😓 |
jeff-at-tamer-dot-codes
added a commit
to jeff-at-tamer-dot-codes/safety
that referenced
this issue
Apr 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I'm using
safety
programmatically:It fails with the following traceback:
The
check
method has a default value ofNone
for thesession
parameter, but that default value causes thefetch_database
function to raise anAttributeError
since it doesn't check if it'sNone
before trying to accessis_using_auth_credentials
on it.Previously, on v2, the above code worked. I understand that I can expect breaking changes going from v2 to v3, but maybe this particular issue was an oversight and can be solved on your side. Let me know! I can also fix my own code to instantiate a session myself and provide it to the
check
function. By the way what is the type of thissession
object?The text was updated successfully, but these errors were encountered: