views:

234

answers:

1

I am trying to modify a trac plugin that allows downloading of wiki pages to word documents. pagetodoc.py throws an exception on this line:

# Call the subprocess using convenience method
retval = subprocess.call(command, shell=True, stderr=errptr, stdout=outptr, close_fds = True)

Saying that close_fds is not supported on Windows. The process seems to create some temporary files in C:\Windows\Temp. I tried removing the close_fds parameter, but then files the subprocess writes to stay open indefinitely. An exception is then thrown when the files are written to later. This is my first time working with Python, and I am not familiar with the libraries. It is even more difficult since most people probably code on Unix machines. Any ideas how I can rework this code?

Thanks!

+1  A: 

close_fds is supported on windows starting with python 2.6 (if stdin/stdout/stderr are not redirected). you might consider upgrading.

ax
I am not sure upgrading is an option, we had to downgrade to get trac working on windows : <
Shawn Simon