From 93eaac1228919e09bd08ac3de3993f97054fef76 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sun, 2 Jul 2006 11:06:41 -0800 Subject: [PATCH] refactor some code to try to prevent the IndexError that sometimes happens when removing files.. This hasn't been confirmed to work, but I believe this will fix it... [git-p4: depot-paths = "//depot/": change = 800] --- ContentDirectory.py | 2 +- FSStorage.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ContentDirectory.py b/ContentDirectory.py index 835402d..697afaa 100644 --- a/ContentDirectory.py +++ b/ContentDirectory.py @@ -124,7 +124,7 @@ class ContentDirectoryControl(UPnPPublisher, dict): if BrowseFlag == 'BrowseDirectChildren': ch = self.getchildren(ObjectID)[StartingIndex: StartingIndex + RequestedCount] - filter(lambda x, s = self, d = didl: d.addItem(s[x.id].checkUpdate()) and None, ch) + filter(lambda x, d = didl: d.addItem(x) and None, filter(lambda x, s = self: s[x.id].checkUpdate(), ch)) else: didl.addItem(self[ObjectID]) diff --git a/FSStorage.py b/FSStorage.py index 545e7cd..419157f 100644 --- a/FSStorage.py +++ b/FSStorage.py @@ -39,6 +39,7 @@ class FSObject(object): if x.errno in (errno.ENOENT, errno.ENOTDIR, errno.EPERM, ): # We can't access it anymore, delete it self.cd.delItem(self.id) + return None else: raise x