[New-bugs-announce] [issue10162] mimetypes read_windows_registry should tolerate permissions errors
report at bugs.python.org
Thu Oct 21 02:44:37 CEST 2010
New submission from And Clover <and at 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)
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 <report at bugs.python.org>
More information about the New-bugs-announce