Fix #10162: Add try/except around _winreg.OpenKey for keys that are
unreadable by all users, e.g., Flash, Silverlight, and Java keys were causing errors. We don't currently have a way to grant/deny permissions for a key via winreg so there are no tests for this.
This commit is contained in:
parent
28928aef2e
commit
000f974b44
@ -253,9 +253,11 @@ class MimeTypes:
|
|||||||
with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
|
with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
|
||||||
r'MIME\Database\Content Type') as mimedb:
|
r'MIME\Database\Content Type') as mimedb:
|
||||||
for ctype in enum_types(mimedb):
|
for ctype in enum_types(mimedb):
|
||||||
|
try:
|
||||||
with _winreg.OpenKey(mimedb, ctype) as key:
|
with _winreg.OpenKey(mimedb, ctype) as key:
|
||||||
try:
|
try:
|
||||||
suffix, datatype = _winreg.QueryValueEx(key, 'Extension')
|
suffix, datatype = _winreg.QueryValueEx(key,
|
||||||
|
'Extension')
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
continue
|
continue
|
||||||
if datatype != _winreg.REG_SZ:
|
if datatype != _winreg.REG_SZ:
|
||||||
|
@ -43,6 +43,9 @@ Core and Builtins
|
|||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #10163: Skip unreadable registry keys during mimetypes
|
||||||
|
initialization.
|
||||||
|
|
||||||
- logging: Made StreamHandler terminator configurable.
|
- logging: Made StreamHandler terminator configurable.
|
||||||
|
|
||||||
- logging: Allowed filters to be just callables.
|
- logging: Allowed filters to be just callables.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user