diff -r 10b1f60a72fa Lib/mimetypes.py --- a/Lib/mimetypes.py Sun Feb 23 19:41:51 2014 +0100 +++ b/Lib/mimetypes.py Mon Feb 24 17:18:07 2014 +1100 @@ -252,10 +252,10 @@ with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, '') as hkcr: for subkeyname in enum_types(hkcr): try: + # Only check file extensions + if not subkeyname.startswith("."): + continue with _winreg.OpenKey(hkcr, subkeyname) as subkey: - # Only check file extensions - if not subkeyname.startswith("."): - continue # raises EnvironmentError if no 'Content Type' value mimetype, datatype = _winreg.QueryValueEx( subkey, 'Content Type')