Commit 29f244d0 authored by Brian Curtin's avatar Brian Curtin

Merged revisions 85774 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85774 | brian.curtin | 2010-10-21 09:11:48 -0500 (Thu, 21 Oct 2010) | 7 lines

  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.
........
parent fd90fd16
...@@ -257,9 +257,10 @@ class MimeTypes: ...@@ -257,9 +257,10 @@ 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):
with _winreg.OpenKey(mimedb, ctype) as key:
try: try:
suffix, datatype = _winreg.QueryValueEx(key, 'Extension') with _winreg.OpenKey(mimedb, ctype) as key:
suffix, datatype = _winreg.QueryValueEx(key,
'Extension')
except EnvironmentError: except EnvironmentError:
continue continue
if datatype != _winreg.REG_SZ: if datatype != _winreg.REG_SZ:
......
...@@ -60,6 +60,9 @@ Core and Builtins ...@@ -60,6 +60,9 @@ Core and Builtins
Library Library
------- -------
- Issue #10163: Skip unreadable registry keys during mimetypes
initialization.
- Issue #5117: Fixed root directory related issue on posixpath.relpath() and - Issue #5117: Fixed root directory related issue on posixpath.relpath() and
ntpath.relpath(). ntpath.relpath().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment