Mercurial > templog
changeset 196:e27075b1e088
Make sure we close descriptor before rename
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 12 Feb 2014 20:57:30 +0800 |
parents | 4f832e28ffc0 |
children | 3f187baa3439 1d8a8bd2ea78 |
files | py/receive.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
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