This raises a couple of questions: - in the first place, python.exe fails, when running in Wine's shell console, as it would expect a FILE_TYPE_CHAR in that case. I wonder if this shouldn't be also fixed. - the change in GetFileInformationByHandle could encompass other HANDLE's type and return success instead of error. It could be tested that the handle is a console handle (eg. GetConsoleMode should succeed when handle is console handle).