From 3fac00f83f13d0270d2557a89534efaf863a1ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Tue, 16 Nov 2010 16:41:54 +0300 Subject: [PATCH] Added locked file from write variables. --- pym/cl_template.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pym/cl_template.py b/pym/cl_template.py index f0cad39..016e9e7 100644 --- a/pym/cl_template.py +++ b/pym/cl_template.py @@ -4983,6 +4983,7 @@ class iniParser(_error, templateFormat): return textIni def writeIniFile(self, txtConfig): + import fcntl if not os.path.exists(self.iniFile): try: # Создание файла @@ -4997,6 +4998,7 @@ class iniParser(_error, templateFormat): except: self.setError(_("Unable to open file") + ": " + self.iniFile) return False + fcntl.flock(FD.fileno(), fcntl.LOCK_EX) FD.truncate(0) FD.seek(0) FD.write(txtConfig)