Fix #5487 (Error after sending books to PRS-600)

This commit is contained in:
Kovid Goyal 2010-05-08 09:36:31 -06:00
parent 655fcb828a
commit e94a44b1a3
2 changed files with 7 additions and 2 deletions

View File

@ -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+'://'):

View File

@ -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