Submitted by : simon at: 2003-10-26T21:32:35+00:00 (14 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

upgradeAll may throw an AttributeError? if there are foreign objects in the WikiFolder? that don't provide the getObject() method.

A simple fix is to trap AttributeError? as well as RuntimeError? in the "sorry, can't do this" clause. See context diffs below - I also added slightly more verbose reporting to help me review the anomalies manually.

Unfortunately I failed to save the traceback before applying the fix - apologies.

Context diffs follow

Thanks & regards -- James Collier

diff -c .orig/ZWikiPage.py .

=========================================================
*** .orig/ZWikiPage.py  2003-08-26 04:18:41.000000000 +1200
--- ./ZWikiPage.py      2003-09-01 17:39:26.000000000 +1200
***************
*** 1541,1548 ****
                      # regexps may fail on large pages (IssueNo0395), carry on
                      # poor caching
                      try: p.getObject()._replaceLinks(oldlink,newlink,REQUEST)
!                     except RuntimeError:
!                         DLOG('failed to update links during rename')

          # has the page id changed ?
          if newid != oldid:
--- 1541,1548 ----
                      # regexps may fail on large pages (IssueNo0395), carry on
                      # poor caching
                      try: p.getObject()._replaceLinks(oldlink,newlink,REQUEST)
!                     except (RuntimeError, AttributeError):
!                         DLOG('failed to update links for name"' + oldname + '"during rename')

          # has the page id changed ?
          if newid != oldid:
***************
*** 1574,1581 ****
                      # regexps may fail on large pages (IssueNo0395), carry on
                      # poor caching
                      try: p.getObject()._replaceLinks(oldid,newid,REQUEST)
!                     except RuntimeError:
!                         DLOG('failed to update links during rename')

          # mail out rename notification
          if (getattr(self.folder(),'mailout_policy','') == 'edits' and
--- 1574,1581 ----
                      # regexps may fail on large pages (IssueNo0395), carry on
                      # poor caching
                      try: p.getObject()._replaceLinks(oldid,newid,REQUEST)
!                     except (RuntimeError, AttributeError):
!                         DLOG('failed to update links for id"' + oldid + '"during rename')

          # mail out rename notification
          if (getattr(self.folder(),'mailout_policy','') == 'edits' and

fixed for 0.23 --SimonMichael, Thu, 18 Sep 2003 16:27:03 -0700 reply

Thanks very much. These shouldn't happen any more, but who knows.. I've made the logging still a bit more verbose, so it should report the problem object's id.

property change --SimonMichael, Thu, 18 Sep 2003 16:27:23 -0700 reply

Status: open => closed