BUG: Right format for password from Curses

Reading the password from Curses Blinkenlights returns a bytes objects
instead an utf-8 string.

This patch will decode if bytes is provided.

Closes: #49

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
This commit is contained in:
Sudip Mukherjee 2021-02-20 00:03:36 +00:00
parent 9e8e30794c
commit c11232cf53

View File

@ -583,6 +583,10 @@ class Blinkenlights(UIBase, CursesUtil):
finally: finally:
self.unlock() self.unlock()
self.inputhandler.input_release() self.inputhandler.input_release()
# We need a str password
if isinstance(password, bytes):
return password.decode(encoding='utf-8')
return password return password
def setupwindows(self, resize=False): def setupwindows(self, resize=False):