Python 3: AttributeError: 'NoneType' object has no attribute 'prompt' when launching from git bash

249 Views Asked by At

I have a python 3 application that uses the prompt_toolkit library. If I launch the application through cmd or PowerShell, the application launches without an issue. However, when I launch the application through Windows git bash, I get the following error:-

Traceback (most recent call last):
  File "application.py", line 313, in <module>
    ret_code = main(str(args.com))
  File "application.py", line 170, in main
    s_opt = session.prompt(f"{s_time} >")
  AttributeError: 'NoneType' object has no attribute 'prompt'

Any reason why this is failing on git bash and not on cmd/PowerShell and is there a way to overcome this issue so that I can run my application from git bash?

I am using Python v3.8.3, prompt-toolkit v3.0.5, and git bash v2.26.2.windows.1, running on Windows 10.

0

There are 0 best solutions below