From: <md...@us...> - 2008-05-19 19:05:29
|
Revision: 5193 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5193&view=rev Author: mdboom Date: 2008-05-19 12:05:23 -0700 (Mon, 19 May 2008) Log Message: ----------- [ 1966974 ] win32FontDirectory() can fail with access denied (Thanks, Patrik Simons) Modified Paths: -------------- branches/v0_91_maint/CHANGELOG branches/v0_91_maint/lib/matplotlib/font_manager.py Modified: branches/v0_91_maint/CHANGELOG =================================================================== --- branches/v0_91_maint/CHANGELOG 2008-05-19 12:55:47 UTC (rev 5192) +++ branches/v0_91_maint/CHANGELOG 2008-05-19 19:05:23 UTC (rev 5193) @@ -1,3 +1,6 @@ +2008-05-19 Fix crash when Windows can not access the registry to + determine font path [Bug 1966974, thanks Patrik Simons] - MGD + 2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD 2008-05-09 Fix /singlequote (') in Postscript backend - MGD Modified: branches/v0_91_maint/lib/matplotlib/font_manager.py =================================================================== --- branches/v0_91_maint/lib/matplotlib/font_manager.py 2008-05-19 12:55:47 UTC (rev 5192) +++ branches/v0_91_maint/lib/matplotlib/font_manager.py 2008-05-19 19:05:23 UTC (rev 5193) @@ -107,14 +107,17 @@ except ImportError: pass # Fall through to default else: - user = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, MSFolders) try: + user = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, MSFolders) try: - return _winreg.QueryValueEx(user, 'Fonts')[0] - except OSError: - pass # Fall through to default - finally: - _winreg.CloseKey(user) + try: + return _winreg.QueryValueEx(user, 'Fonts')[0] + except OSError: + pass # Fall through to default + finally: + _winreg.CloseKey(user) + except OSError: + pass # Fall through to default return os.path.join(os.environ['WINDIR'], 'Fonts') def win32InstalledFonts(directory=None, fontext='ttf'): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |