[Buildbot-devel] BuildBot test fails on Win32 platform.

Brian Warner warner-buildbot at lothar.com
Fri Apr 1 01:05:21 UTC 2005


> From: "Baptiste Lepilleur" <blep at users.sourceforge.net>
> Subject: [Buildbot-devel] BuildBot test fails on Win32 platform.
> Date: Wed, 9 Mar 2005 21:05:45 +0100

Howdy.. sorry for the delay.

> Looking at the code:
> 
>         filename = os.path.join(self.basedir, "builder")
>         tmpfilename = filename + ".tmp"
>         try:
>             pickle.dump(self, open(tmpfilename, "w"), -1)
>             if sys.platform == 'win32':
>                 # windows cannot rename a file on top of an existing one
>                 os.unlink(filename)
>             os.rename(tmpfilename, filename)
> 
> Shouldn't that be
>             if sys.platform == 'win32':
>                 # windows cannot rename a file on top of an existing one
>                 try:
>                     os.unlink(filename)
>                 except: # file does not exist
>                     pass

Yes, you're right. I just committed a modified fix, instead of the try/except
I conditioned the os.unlink upon a os.path.exists() test, which makes me feel
a little bit safer. The change is in CVS now, and will be in the next
release.

Thanks!
 -Brian




More information about the devel mailing list