Open jankatins opened 8 years ago
What version of python? What shall I do to reproduce?
It happens on Python 3.4 and Python 3.5. You can see a longer and more detailed discussion in scopatz/xonsh#666. But all you need to do to reproduce, as a single command is run:
$ python -c "import subprocess; print(repr(subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'],stderr=subprocess.PIPE)))"
to see that it is an empty line, and
$ python -c "import subprocess; print(repr(subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])))"
to see that it is not.
I do not see problems with subprocess.PIPE
in current ConEmu build.
> python -c "import subprocess; print(repr(subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'],stderr=subprocess.PIPE)))"
b'master\n'
I have some troubles with Cmder but not ConEmu:
Python 3.11.1 and 3.10 interactive modes do not work for me on Cmder. The interactive prompt does not show (it just prints whatever I type, and I have to close the window).
In Golang, the stdout is not a CharDevice
as a normal terminal should be, so it looks like the output is piped, this function returns false:
// check if standard output is connected to a terminal
func OutputIsTerminal(stdout *os.File) bool {
o, _ := stdout.Stat()
if (o.Mode() & os.ModeCharDevice) == os.ModeCharDevice {
return true
}
// Pipe
return false
}
These are obviously Cmder issues, but just wanted to let you know. Make sure to test on ConEmu itself before making conclusions.
If you run python in a conemu (in this case cmder) session, it seems that you can't used things like ´stderr=subprocess.PIPE`:
https://github.com/scopatz/xonsh/issues/666
Any idea what this could be?