2016-12-01 12 views
1

我通過Git的換Windows和CPython35-32使用mintty。爲什麼Python認爲它沒有連接到終端?的Git換的Windows Mintty sys.stdout.isatty()返回false

$ python -c "import sys; print(sys.stdout.isatty())" 
False 

有趣的是,我也有一個問題,我不能在mintty內啓動Python的交互式會話。這可能與這個問題

$ python 
<nothingness here...> 
+0

https://github.com/mintty/mintty/issues/56 –

回答

0

你可能想嘗試使用Git 2.12(Q1 2017)

通過Jeff Hostetler (jeffhostetler)commit a9b8a09(2016年12月22日)。
請參閱commit 8692483(2016年12月22日)作者:Alan Davies (scooter6386)
請參閱commit fee807c(2016年12月22日)作者:Johannes Schindelin (dscho)
(在commit 58fcd54Junio C Hamano -- gitster --合併,2016年12月27日)

mingw:更換isatty()破解

混帳的Windows開展這取決於MSVC運行時的內部補丁,但它不工作正確使用最近的MSVC運行時。
替換最初是爲編譯VC++編寫的。

該消息中的補丁程序是更換一個補丁包,而且還解決了以前的嘗試,使isatty()告訴/dev/null一個互動終端。