magmax/python-inquirer

Issues in Win/gitbash

eriklilljequist opened this issue · 2 comments

Hello and thanks for a nice lib!

I have users on windows having issues executing inquirer in gitbash. It works well in Macos and Linux/WSL.

More specifically it crashes at inquirer\prompt.py", line 11. The invoking code is:

def make_selection(message, choices=['Yes', 'No']):
    question = inquirer.List(
        name='q',
        carousel=True,
        message=message,
        choices=choices,
    )
    answer = inquirer.prompt(questions=[question], theme=themes.GreenPassion())
    return answer['q']

The Exception message is:
<class 'UnicodeEncodeError'> 'charmap' codec can't encode character '\u276f' in position 1: character maps to <undefined>

Thanks in advance

I can not reproduce this in in bash 5.2.15(1)-release (x86_64-pc-msys) which comes with git 2.41.0.windows.1 and with a windows system configured to default to the UTF-8 codepage. Code runs as expected

Without a full traceback and/or other way to narrow this down to a more specific location in our code I won't be able to get much more.

However as it is related to character encoding, it will probably come from mixing windows and linux in some form by using bash on a windows system. Please also try the problematic code from the windwos terminal cmd

Thank you, the important thing is that we then know that it is not a general issue with inquirer.

Thank you very much.