File "...pagure/lib/login.py", line 54, in generate_hashed_value
return '$2$' + bcrypt.hashpw(to_unicode(password), bcrypt.gensalt())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
the bcrypt.hashpw should take bytes, not unicode
the change is safe for old password, since whether to_unicode or
to_bytes, ascii password gets same result.
when password is not ascii:
File "...pagure/lib/login.py", line 54, in generate_hashed_value
return '$2$' + bcrypt.hashpw(to_unicode(password), bcrypt.gensalt())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
the bcrypt.hashpw should take bytes, not unicode
the change is safe for old password, since whether to_unicode or
to_bytes, ascii password gets same result.
Signed-off-by: Shengjing Zhu zsj950618@gmail.com