Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6134

Re: File access denied after subprocess completion on Windows platform

Date 2011-05-24 14:09 +0100
From Tim Golden <mail@timgolden.me.uk>
Subject Re: File access denied after subprocess completion on Windows platform
References <201105241301.28431.claudiu@virtuamagic.com>
Newsgroups comp.lang.python
Message-ID <mailman.2014.1306242549.9059.python-list@python.org> (permalink)

Show all headers | View raw


On 24/05/2011 11:01, Claudiu Nicolaie CISMARU wrote:
> The problem appears when I close the called program (in our case
> calc.exe). The (1) part (the call of os.rename) raise an exception:
>
> <type 'exceptions.WindowsError'>
> (32, 'The process cannot access the file because it is being used by
> another process')
> [Error 32] The process cannot access the file because it is being used
> by another process

Try running procexp to see if it can see what's happening to the
handle. It's possible it's a virus checker / indexer, although
they'd tend to allow the file to be deleted out from under them.
It's not quite clear from your description above whether you
can be sure that the called subprocess has closed all its handles
by the time the os.rename runs.

TJG

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: File access denied after subprocess completion on Windows platform Tim Golden <mail@timgolden.me.uk> - 2011-05-24 14:09 +0100

csiph-web