New submission from And Clover <a...@doxdesk.com>:

It is relatively common to have keys in the HKEY_CLASSES_ROOT MIME database 
that are not readable to all users, typically written by third-party 
applications. (My WinXP test box has a dozen, for apps like Flash, Silverlight 
and Java.)

Currently, initialising mimetypes causes Python to try to read them all, and if 
the user running Python doesn't have permission to read a key (in particular, 
if the user is a low-privilege daemon user such as IUSR_...), the script that 
caused mimetypes to be called will error out.

This patch moves the try-block around the call to OpenKey as well as 
QueryValueEx, allowing the key to be skipped if unreadable.

----------
components: Library (Lib)
files: mimetypes-patch-3.2a3.patch
keywords: patch
messages: 119252
nosy: aclover
priority: normal
severity: normal
status: open
title: mimetypes read_windows_registry should tolerate permissions errors
type: feature request
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file19314/mimetypes-patch-3.2a3.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10162>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to