From 832ef59a5e80f7792ddcbaec5730c701078ac621 Mon Sep 17 00:00:00 2001 From: Devan Franchini Date: Fri, 24 Jan 2014 16:38:02 -0500 Subject: WebappConfig/db.py: Properly closes install file after writing. When webapp-config cleans out a webapp installation it needs to remove the database entry of the file from it's designated installs file. If more than one database entry is in the installs file it should still list the database entry for the webapp that isn't being removed. The logic is all there in db.py but after the file has rewritten the entries it doesn't close the file properly and causes a failure in the check right after the write(), which then unlinks the installs file and removes the entries from webapp-config's database. X-Gentoo-Bug:494520 X-Gentoo-Bug-URL: https://bugs.gentoo.org/494520 --- WebappConfig/db.py | 1 + 1 file changed, 1 insertion(+) diff --git a/WebappConfig/db.py b/WebappConfig/db.py index 228b2c8..2d70cb9 100644 --- a/WebappConfig/db.py +++ b/WebappConfig/db.py @@ -340,6 +340,7 @@ class WebappDB(AppHierarchy): if not self.__p: installs = open(dbpath, 'w') installs.write('\n'.join(newentries) + '\n') + installs.close() if not self.has_installs(): os.unlink(dbpath) else: -- cgit v1.2.3-65-gdbad