From e94a44b1a3413e0bfe615a321d4fc4ad2befea6d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 8 May 2010 09:36:31 -0600 Subject: [PATCH] Fix #5487 (Error after sending books to PRS-600) --- src/calibre/__init__.py | 2 +- src/calibre/devices/prs505/books.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 5039331660..c237e15dff 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -202,7 +202,7 @@ def extract(path, dir): def get_proxies(debug=True): proxies = getproxies() for key, proxy in list(proxies.items()): - if not proxy: + if not proxy or '..' in proxy: del proxies[key] continue if proxy.startswith(key+'://'): diff --git a/src/calibre/devices/prs505/books.py b/src/calibre/devices/prs505/books.py index ee5209c563..406a139fd1 100644 --- a/src/calibre/devices/prs505/books.py +++ b/src/calibre/devices/prs505/books.py @@ -284,7 +284,12 @@ class BookList(_BookList): plitems = [] for pl in self.playlists(): for c in pl.childNodes: - if hasattr(c, 'tagName') and c.tagName.endswith('item'): + if hasattr(c, 'tagName') and c.tagName.endswith('item') and \ + hasattr(c, 'getAttribute'): + try: + c.getAttribute('id') + except: # Unlinked node + continue plitems.append(c) return plitems