Open With: Fix open with failing to get list of default programs on windows if the registry contains missing ProgIDs. Fixes #1434990 [Open with does not use OS list of available programs to open format](https://bugs.launchpad.net/calibre/+bug/1434990)

This commit is contained in:
Kovid Goyal 2015-03-22 19:04:34 +05:30
parent 9bb1bc0b04
commit 24c19f2a85

View File

@ -200,7 +200,7 @@ def get_open_data(base, prog_id):
k = Key(open_at=r'Software\Classes\%s' % prog_id, root=base)
except WindowsError as err:
if err.errno == winerror.ERROR_FILE_NOT_FOUND:
return None, None
return None, None, None
with k:
return k.get(sub_key=r'shell\open\command'), k.get(sub_key='DefaultIcon'), k.get_mui_string('FriendlyTypeName') or k.get()