diff py/receive.py @ 495:905bbab632f7

Make sure we close descriptor before rename
author Matt Johnston <matt@ucc.asn.au>
date Wed, 12 Feb 2014 20:57:30 +0800
parents 20db270cc23a
children 185621f47040
line wrap: on
line diff
--- a/py/receive.py	Tue Feb 11 23:48:35 2014 +0800
+++ b/py/receive.py	Wed Feb 12 20:57:30 2014 +0800
@@ -44,8 +44,10 @@
             delete = False)
 
         t.write(json.dumps(new_params, sort_keys=True, indent=4)+'\n')
+        name = t.name
+        t.close()
 
-        os.rename(t.name, config.PARAMS_FILE)
+        os.rename(name, config.PARAMS_FILE)
     except Exception, e:
         return "Problem: %s" % e