management console: update password reset docs for python 3.x
Created by: ggilmore
https://docs.sourcegraph.com/admin/management_console has a snippet to update the management console password that works in python 2.x:
python -c "import bcrypt; import os; print(bcrypt.hashpw(os.environ['PASSWORD'], bcrypt.gensalt(15)))"
However, you get an error when running the snippet in python 3.x,
python -c "import bcrypt; import os; print(bcrypt.hashpw(os.environ['PASSWORD'], bcrypt.gensalt(15)))"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/bcrypt/__init__.py", line 61, in hashpw
raise TypeError("Unicode-objects must be encoded before hashing")
TypeError: Unicode-objects must be encoded before hashing
According to a user, the following snippet fixes the issue in python 3.x
python -c "import bcrypt; import os; print(bcrypt.hashpw(os.environ['PASSWORD'], bcrypt.gensalt(15)))"