From: <md...@us...> - 2008-05-19 19:09:39
|
Revision: 5195 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5195&view=rev Author: mdboom Date: 2008-05-19 12:09:35 -0700 (Mon, 19 May 2008) Log Message: ----------- Merged revisions 5192-5193 via svnmerge from https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint ........ r5193 | mdboom | 2008-05-19 15:05:23 -0400 (Mon, 19 May 2008) | 3 lines [ 1966974 ] win32FontDirectory() can fail with access denied (Thanks, Patrik Simons) ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/font_manager.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Name: svnmerge-integrated - /branches/v0_91_maint:1-5191 + /branches/v0_91_maint:1-5193 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-05-19 19:07:47 UTC (rev 5194) +++ trunk/matplotlib/CHANGELOG 2008-05-19 19:09:35 UTC (rev 5195) @@ -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-16 removed some unneeded code w/ the python 2.4 requirement. cbook no longer provides compatibility for reversed, enumerate, set or izip. removed lib/subprocess, mpl1, Modified: trunk/matplotlib/lib/matplotlib/font_manager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/font_manager.py 2008-05-19 19:07:47 UTC (rev 5194) +++ trunk/matplotlib/lib/matplotlib/font_manager.py 2008-05-19 19:09:35 UTC (rev 5195) @@ -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. |