[Python-modules-commits] r26020 - in packages/matplotlib/trunk/debian (4 files)
morph at users.alioth.debian.org
morph at users.alioth.debian.org
Mon Sep 30 21:55:24 UTC 2013
Date: Monday, September 30, 2013 @ 21:55:23
Author: morph
Revision: 26020
* Acknowledge NMU, thanks Anton Gladky; Closes: #719065
* Non-maintainer upload.
* Fix error in font_manager.py: UnicodeDecodeError when starting
ipython --pylab. (Closes: #719065)
* Fix AttributeError error where there are no writable directories.
Added:
packages/matplotlib/trunk/debian/patches/60_deal_with_no_writable_dirs.patch
packages/matplotlib/trunk/debian/patches/70_fix_UnicodeDecodeError.patch
Modified:
packages/matplotlib/trunk/debian/changelog
packages/matplotlib/trunk/debian/patches/series
Modified: packages/matplotlib/trunk/debian/changelog
===================================================================
--- packages/matplotlib/trunk/debian/changelog 2013-09-30 21:47:08 UTC (rev 26019)
+++ packages/matplotlib/trunk/debian/changelog 2013-09-30 21:55:23 UTC (rev 26020)
@@ -1,3 +1,18 @@
+matplotlib (1.3.0-2) UNRELEASED; urgency=low
+
+ * Acknowledge NMU, thanks Anton Gladky; Closes: #719065
+
+ -- Sandro Tosi <morph at debian.org> Mon, 30 Sep 2013 23:54:51 +0200
+
+matplotlib (1.3.0-1.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Fix error in font_manager.py: UnicodeDecodeError when starting
+ ipython --pylab. (Closes: #719065)
+ * Fix AttributeError error where there are no writable directories.
+
+ -- Anton Gladky <gladk at debian.org> Sun, 29 Sep 2013 16:10:15 +0200
+
matplotlib (1.3.0-1) unstable; urgency=low
[ Sandro Tosi ]
Added: packages/matplotlib/trunk/debian/patches/60_deal_with_no_writable_dirs.patch
===================================================================
--- packages/matplotlib/trunk/debian/patches/60_deal_with_no_writable_dirs.patch (rev 0)
+++ packages/matplotlib/trunk/debian/patches/60_deal_with_no_writable_dirs.patch 2013-09-30 21:55:23 UTC (rev 26020)
@@ -0,0 +1,111 @@
+Description: deal with the case where there are no writable directories.
+Author: Michael Droettboom <mdboom at gmail.com>
+Bug-Debian: http://bugs.debian.org/719384
+Origin: https://github.com/mdboom/matplotlib/commit/1e8d592ed0439ac6fe8fc08d5efe522799acf4fe
+Reviewed-By: Anton Gladky <gladk at debian.org>
+Last-Update: 2013-09-29
+
+--- matplotlib-1.3.0.orig/lib/matplotlib/font_manager.py
++++ matplotlib-1.3.0/lib/matplotlib/font_manager.py
+@@ -1324,6 +1324,8 @@ if USE_FONTCONFIG and sys.platform != 'w
+ return result
+
+ else:
++ _fmcache = None
++
+ if not 'TRAVIS' in os.environ:
+ cachedir = get_cachedir()
+ if cachedir is not None:
+@@ -1331,8 +1333,6 @@ else:
+ _fmcache = os.path.join(cachedir, 'fontList.py3k.cache')
+ else:
+ _fmcache = os.path.join(cachedir, 'fontList.cache')
+- else:
+- _fmcache = None
+
+ fontManager = None
+
+--- matplotlib-1.3.0.orig/lib/matplotlib/__init__.py
++++ matplotlib-1.3.0/lib/matplotlib/__init__.py
+@@ -518,7 +518,11 @@ def _get_xdg_config_dir():
+ base directory spec
+ <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_.
+ """
+- return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(), '.config'))
++ home = get_home()
++ if home is None:
++ return None
++ else:
++ return os.environ.get('XDG_CONFIG_HOME', os.path.join(home, '.config'))
+
+
+ def _get_xdg_cache_dir():
+@@ -527,7 +531,11 @@ def _get_xdg_cache_dir():
+ base directory spec
+ <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_.
+ """
+- return os.environ.get('XDG_CACHE_HOME', os.path.join(get_home(), '.cache'))
++ home = get_home()
++ if home is None:
++ return None
++ else:
++ return os.environ.get('XDG_CACHE_HOME', os.path.join(home, '.cache'))
+
+
+ def _get_config_or_cache_dir(xdg_base):
+@@ -543,22 +551,28 @@ def _get_config_or_cache_dir(xdg_base):
+ return _create_tmp_config_dir()
+ return configdir
+
++ p = None
+ h = get_home()
+- p = os.path.join(h, '.matplotlib')
+- if (sys.platform.startswith('linux') and
+- not os.path.exists(p)):
+- p = os.path.join(xdg_base, 'matplotlib')
+-
+- if os.path.exists(p):
+- if not _is_writable_dir(p):
+- return _create_tmp_config_dir()
+- else:
+- try:
+- mkdirs(p)
+- except OSError:
+- return _create_tmp_config_dir()
++ if h is not None:
++ p = os.path.join(h, '.matplotlib')
++ if (sys.platform.startswith('linux') and
++ not os.path.exists(p) and
++ xdg_base is not None):
++ p = os.path.join(xdg_base, 'matplotlib')
++
++ if p is not None:
++ if os.path.exists(p):
++ if _is_writable_dir(p):
++ return p
++ else:
++ try:
++ mkdirs(p)
++ except OSError:
++ pass
++ else:
++ return p
+
+- return p
++ return _create_tmp_config_dir()
+
+
+ def _get_configdir():
+@@ -716,9 +730,11 @@ def matplotlib_fname():
+ if configdir is not None:
+ fname = os.path.join(configdir, 'matplotlibrc')
+ if os.path.exists(fname):
++ home = get_home()
+ if (sys.platform.startswith('linux') and
++ home is not None and
+ fname == os.path.join(
+- get_home(), '.matplotlib', 'matplotlibrc')):
++ home, '.matplotlib', 'matplotlibrc')):
+ warnings.warn(
+ "Found matplotlib configuration in ~/.matplotlib/. "
+ "To conform with the XDG base directory standard, "
Added: packages/matplotlib/trunk/debian/patches/70_fix_UnicodeDecodeError.patch
===================================================================
--- packages/matplotlib/trunk/debian/patches/70_fix_UnicodeDecodeError.patch (rev 0)
+++ packages/matplotlib/trunk/debian/patches/70_fix_UnicodeDecodeError.patch 2013-09-30 21:55:23 UTC (rev 26020)
@@ -0,0 +1,78 @@
+Description: UnicodeDecodeError when starting ipython --pylab
+Author: Michael Droettboom <mdboom at gmail.com>
+Bug-Debian: http://bugs.debian.org/719065
+Origin: UnicodeDecodeError when starting ipython --pylab
+Reviewed-By: Anton Gladky <gladk at debian.org>
+Last-Update: 2013-09-29
+
+--- matplotlib-1.3.0.orig/lib/matplotlib/font_manager.py
++++ matplotlib-1.3.0/lib/matplotlib/font_manager.py
+@@ -391,11 +391,11 @@ def ttfFontProperty(font):
+ sfnt2 = sfnt.get((1,0,0,2))
+ sfnt4 = sfnt.get((1,0,0,4))
+ if sfnt2:
+- sfnt2 = sfnt2.decode('ascii').lower()
++ sfnt2 = sfnt2.decode('macroman').lower()
+ else:
+ sfnt2 = ''
+ if sfnt4:
+- sfnt4 = sfnt4.decode('ascii').lower()
++ sfnt4 = sfnt4.decode('macroman').lower()
+ else:
+ sfnt4 = ''
+ if sfnt4.find('oblique') >= 0:
+--- matplotlib-1.3.0.orig/lib/matplotlib/texmanager.py
++++ matplotlib-1.3.0/lib/matplotlib/texmanager.py
+@@ -169,7 +169,7 @@ Could not rename old TeX cache dir "%s":
+ ff = rcParams['font.family']
+ if len(ff) == 1 and ff[0].lower() in self.font_families:
+ self.font_family = ff[0].lower()
+- elif ff.lower() in self.font_families:
++ elif isinstance(ff, basestring) and ff.lower() in self.font_families:
+ self.font_family = ff.lower()
+ else:
+ mpl.verbose.report(
+--- matplotlib-1.3.0.orig/lib/matplotlib/textpath.py
++++ matplotlib-1.3.0/lib/matplotlib/textpath.py
+@@ -63,7 +63,7 @@ class TextToPath(object):
+ """
+ sfnt = font.get_sfnt()
+ try:
+- ps_name = sfnt[(1, 0, 0, 6)].decode('ascii')
++ ps_name = sfnt[(1, 0, 0, 6)].decode('macroman')
+ except KeyError:
+ ps_name = sfnt[(3, 1, 0x0409, 6)].decode('utf-16be')
+ char_id = urllib.quote('%s-%x' % (ps_name, ccode))
+--- matplotlib-1.3.0.orig/lib/matplotlib/backends/backend_ps.py
++++ matplotlib-1.3.0/lib/matplotlib/backends/backend_ps.py
+@@ -750,10 +750,11 @@ grestore
+ self.set_color(*gc.get_rgb())
+ sfnt = font.get_sfnt()
+ try:
+- ps_name = sfnt[(1,0,0,6)]
++ ps_name = sfnt[(1,0,0,6)].decode('macroman')
+ except KeyError:
+ ps_name = sfnt[(3,1,0x0409,6)].decode(
+- 'utf-16be').encode('ascii','replace')
++ 'utf-16be')
++ ps_name = ps_name.encode('ascii','replace')
+ self.set_font(ps_name, prop.get_size_in_points())
+
+ cmap = font.get_charmap()
+--- matplotlib-1.3.0.orig/lib/matplotlib/backends/backend_pdf.py
++++ matplotlib-1.3.0/lib/matplotlib/backends/backend_pdf.py
+@@ -1002,11 +1002,12 @@ end"""
+ # You are lost in a maze of TrueType tables, all different...
+ sfnt = font.get_sfnt()
+ try:
+- ps_name = sfnt[(1,0,0,6)] # Macintosh scheme
++ ps_name = sfnt[(1,0,0,6)].decode('macroman') # Macintosh scheme
+ except KeyError:
+ # Microsoft scheme:
+- ps_name = sfnt[(3,1,0x0409,6)].decode('utf-16be').encode('ascii','replace')
++ ps_name = sfnt[(3,1,0x0409,6)].decode('utf-16be')
+ # (see freetype/ttnameid.h)
++ ps_name = ps_name.encode('ascii', 'replace')
+ ps_name = Name(ps_name)
+ pclt = font.get_sfnt_table('pclt') \
+ or { 'capHeight': 0, 'xHeight': 0 }
Modified: packages/matplotlib/trunk/debian/patches/series
===================================================================
--- packages/matplotlib/trunk/debian/patches/series 2013-09-30 21:47:08 UTC (rev 26019)
+++ packages/matplotlib/trunk/debian/patches/series 2013-09-30 21:55:23 UTC (rev 26020)
@@ -2,3 +2,5 @@
20_matplotlibrc_path_search_fix.patch
40_bts608939_draw_markers_description.patch
50_bts608942_spaces_in_param_args.patch
+60_deal_with_no_writable_dirs.patch
+70_fix_UnicodeDecodeError.patch
More information about the Python-modules-commits
mailing list