[Buildbot-devel] WindowsError in transfer.py

Dustin J. Mitchell dustin at v.igoro.us
Mon Jan 23 15:52:01 UTC 2012


I'm not seeing the referent for the code you're looking at.  Can you
paste a full traceback, and an actual patch?

Dustin

On Mon, Jan 23, 2012 at 3:17 AM, ECKSCHLAGER Manfred
<meckschlager at eurofunk.com> wrote:
> Hi all,
>
> I'm by far no expert in python, but could it be that transfer.py (buildbot
> 0.8.5, line 220) misses a file close.
>
> Reason for my suspicion is that I sometimes get an exection (WindowsError)
> on the line: os.remove(self.tarname) which states that another process still
> uses that file and that it therefore can't be deleted.
>
> At first I thought the virus scanner would be the culprit but the problem
> persisted after disabling it.
>
>
> Searching the web I found that mkstemp returns a tuple with filename and an
> _open_ handle, and this particular handle doesn't get closed in the
> finished() step.
>
> To cut a long story short, is following solution correct?
> def start(self):
> ...
> self.fd, self.tarname = tempfile.mkstemp()
> ...
> def finished(self, res):
>     os.close(self.fd)    # new
>     self.fp.close()
>     os.remove(self.tarname)
>
> cheers,
>   manfred
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>




More information about the devel mailing list