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 in checkpw #768

Closed
eddthelucky opened this issue Apr 5, 2024 · 1 comment
Closed

TypeError in checkpw #768

eddthelucky opened this issue Apr 5, 2024 · 1 comment

Comments

@eddthelucky
Copy link

I ran into a type error when running bcrypt.checkpw(password, hashed_password). I generated a hashed password with bcrypt.hashpw(str.encode(password), bcrypt.gensalt(prefix=b"2b")) when password was 0.

TypeError: argument 'password': 'str' object cannot be converted into 'PyBytes'

Considering this worked with 3 and not 0 I'm guessing there's a bug?

@alex
Copy link
Member

alex commented Apr 5, 2024

This error message indicates that you are passing a string where a bytes is required. To the best of my memory, passing bytes has always been a requirement of this API.

If you think you have a regression, please provide a minimal executable reproducer that works on one version of bcrypt and errors on another.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants