This seems like a change in bcrypt for python 3.9?
Can you try:python3 -c 'import bcrypt,base64; print(base64.b64encode(bcrypt.hashpw("pleasechange".encode(), bcrypt.gensalt()).encode('utf-8')))'
Answered
Dikshagohlyan@Dikshas-Mbp ~ % Python3 -C 'Import Bcrypt,Base64; Print(Base64.B64Encode(Bcrypt.Hashpw("Pleasechange".Encode(), Bcrypt.Gensalt())))'
Traceback (Most Recent Call Last):
File "<String>", Line 1, In <Module>
File "/Opt/Homebrew/Cellar/Pytho
dikshagohlyan@DIKSHAs-MBP ~ % python3 -c 'import bcrypt,base64; print(base64.b64encode(bcrypt.hashpw("pleasechange".encode(), bcrypt.gensalt())))' Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/homebrew/Cellar/python@3.9/3.9.12_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/base64.py", line 58, in b64encode encoded = binascii.b2a_base64(s, newline=False) TypeError: a bytes-like object is required, not 'str'
Also I am getting this error. Do you know it might be
1K Views
1
Answer
2 years ago
one year ago
Tags
Similar posts