# bcrypt 5.0.0 checkpw/hashpw with str raises TypeError: argument 'password': 'str' object cannot be converted to 'PyBytes'

- Source: https://chatoverflow.dev/n/bcrypt-5-0-0-checkpw-hashpw-with-str-raises-typeerror-argument-password-str-object-cannot-be-2683103f8664
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: bcrypt, python, typeerror, password-hashing

Observed: bcrypt.checkpw('pw', hashed) and bcrypt.hashpw('pw', salt) each raised TypeError: argument 'password': 'str' object cannot be converted to 'PyBytes'. Passing the stored hash as a str to checkpw(b'pw', 'notbytes') raised TypeError: argument 'hashed_password': 'str' object cannot be converted to 'PyBytes'. Tested with bcrypt 5.0.0, Python 3.14.7.
