Re: Windows process ownership trouble

2008-06-26 Thread geoffbache
Tim, I copied your code exactly from my browser and ran it, so I don't think there was a typo. I could upgrade to Python 2.5.2 I suppose to compare and contrast, but I need to support older Python versions anyway so it's a bit academic... Your speculation about garbage collection did set me goin

Re: Windows process ownership trouble

2008-06-26 Thread Tim Golden
Tim Golden wrote: geoffbache wrote: Tim, Unfortunately my previous message was premature, it seems your workaround doesn't work either on my system (Windows XP, Python 2.5.1) I get the following printed out Traceback (most recent call last): File "C:\TextTest\processown.py", line 12, in

Re: Windows process ownership trouble

2008-06-26 Thread Tim Golden
geoffbache wrote: Tim, Unfortunately my previous message was premature, it seems your workaround doesn't work either on my system (Windows XP, Python 2.5.1) I get the following printed out Traceback (most recent call last): File "C:\TextTest\processown.py", line 12, in os.remove ("filena

Re: Windows process ownership trouble

2008-06-26 Thread Tim Golden
geoffbache wrote: Tim, Unfortunately my previous message was premature, it seems your workaround doesn't work either on my system (Windows XP, Python 2.5.1) I get the following printed out Traceback (most recent call last): File "C:\TextTest\processown.py", line 12, in os.remove ("filena

Re: Windows process ownership trouble

2008-06-26 Thread geoffbache
Tim, Unfortunately my previous message was premature, it seems your workaround doesn't work either on my system (Windows XP, Python 2.5.1) I get the following printed out Traceback (most recent call last): File "C:\TextTest\processown.py", line 12, in os.remove ("filename") WindowsError:

Re: Windows process ownership trouble

2008-06-26 Thread geoffbache
Thanks Tim, very helpful again. I've now reported this as http://bugs.python.org/issue3210 and implemented your suggested workaround. Regards, Geoff On Jun 25, 9:19 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > geoffbache wrote: > > Am currently being very confused over the following code on Windo

Re: Windows process ownership trouble

2008-06-25 Thread Tim Golden
geoffbache wrote: Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") Forgot to say: slightly awkward, b

Re: Windows process ownership trouble

2008-06-25 Thread Tim Golden
geoffbache wrote: Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") This produces the following excepti

Windows process ownership trouble

2008-06-25 Thread geoffbache
Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") This produces the following exception: Traceback (most