changeset 383:1c86e97448fa

DeletePage: fix uninitialized msg attribute in case of SaveError exception imported from: moin--main--1.5--patch-387
author Thomas Waldmann <tw@waldmann-edv.de>
date Tue, 17 Jan 2006 08:01:41 +0000
parents 36429b2aa628
children 9131b2a6a1ba
files ChangeLog MoinMoin/PageEditor.py
diffstat 2 files changed, 23 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jan 17 07:45:18 2006 +0000
+++ b/ChangeLog	Tue Jan 17 08:01:41 2006 +0000
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-01-17 09:01:41 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-387
+
+    Summary:
+      DeletePage: fix uninitialized msg attribute in case of SaveError exception
+    Revision:
+      moin--main--1.5--patch-387
+
+    DeletePage: fix uninitialized msg attribute in case of SaveError exception
+    
+
+    modified files:
+     ChangeLog MoinMoin/PageEditor.py
+
+
 2006-01-17 08:45:18 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-386
 
     Summary:
--- a/MoinMoin/PageEditor.py	Tue Jan 17 07:45:18 2006 +0000
+++ b/MoinMoin/PageEditor.py	Tue Jan 17 08:01:41 2006 +0000
@@ -447,23 +447,24 @@
         @rtype: unicode
         @return: error message
         """
-        # First save a final backup copy of the current page
-        # (recreating the page allows access to the backups again)
         _ = self._
         
         try:
+            # First save a final backup copy of the current page
+            # (recreating the page allows access to the backups again)
             msg = self.saveText(u"deleted\n", 0, comment=comment or u'')
             msg = msg.replace(
                 _("Thank you for your changes. Your attention to detail is appreciated."),
                 _('Page "%s" was successfully deleted!') % (self.page_name,))
+            # Then really delete it
+            try:
+                os.remove(self._text_filename())
+            except OSError, err:
+                if err.errno != errno.ENOENT:
+                    raise err
         except self.SaveError, message:
             # XXX Error handling
-            pass
-        # Then really delete it
-        try:
-            os.remove(self._text_filename())
-        except OSError, er:
-            if er.errno != errno.ENOENT: raise er
+            msg = "SaveError has occured in PageEditor.deletePage. We need locking there."
         
         # reset page object
         self.reset()