python 2.5 scripting in vim on windows: subprocess problem

Dmitry Teslenko dteslenko at gmail.com
Mon Oct 22 04:47:57 EDT 2007


Hello!
I'm using subprocess.Popen in python script in vim.
It called this way:
def some_func():
		p = subprocess.Popen( command , stdout = subprocess.PIPE, stderr =
subprocess.STDOUT)
		while True:
			s = p.stdout.readline()
			if not s:
				break
			self.__output( '... %s' % s )
		return p.wait()

It filters command's output and re-ouputs it in stdout.
Being called from console, it works fine.
Being called from vim with :python some_func() it says:
file "...subprocess.py", line 586 in __init__
...
file "...subprocess.py", line 699, in _get_handles
...
file "...subprocess.py", line 744 in _make_inheritable
DUPLICATE_SAME_ACCESS
WindowsError: [Error 6]



More information about the Python-list mailing list