Revision: 147515 https://trac.macports.org/changeset/147515 Author: petr@macports.org Date: 2016-04-06 07:02:54 -0700 (Wed, 06 Apr 2016) Log Message: ----------- py-matplotlib: add upstream patch for locale `UTF-8`, fixes #50717. Modified Paths: -------------- trunk/dports/python/py-matplotlib/Portfile Added Paths: ----------- trunk/dports/python/py-matplotlib/files/patch-matplotlib-__init__.py.diff Modified: trunk/dports/python/py-matplotlib/Portfile =================================================================== --- trunk/dports/python/py-matplotlib/Portfile 2016-04-06 13:51:34 UTC (rev 147514) +++ trunk/dports/python/py-matplotlib/Portfile 2016-04-06 14:02:54 UTC (rev 147515) @@ -6,7 +6,7 @@ PortGroup github 1.0 github.setup matplotlib matplotlib 1.5.1 v -revision 1 +revision 2 name py-matplotlib categories-append graphics math @@ -55,7 +55,8 @@ patchfiles-append patch-setup.cfg.diff \ patch-setupext.py.diff \ - patch-src-macosx.m.diff + patch-src-macosx.m.diff \ + patch-matplotlib-__init__.py.diff build.env PKG_CONFIG_PATH="${python.prefix}/lib/pkgconfig" Added: trunk/dports/python/py-matplotlib/files/patch-matplotlib-__init__.py.diff =================================================================== --- trunk/dports/python/py-matplotlib/files/patch-matplotlib-__init__.py.diff (rev 0) +++ trunk/dports/python/py-matplotlib/files/patch-matplotlib-__init__.py.diff 2016-04-06 14:02:54 UTC (rev 147515) @@ -0,0 +1,33 @@ +From 2ac494f71676e8cf824ae7eced1bca0848bb5a59 Mon Sep 17 00:00:00 2001 +From: Thomas A Caswell <tcaswell@gmail.com> +Date: Mon, 15 Feb 2016 15:35:59 -0500 +Subject: [PATCH] Merge pull request #5931 from ntessore/patch-1 + +use `locale.getpreferredencoding()` to prevent OS X locale issues +--- + lib/matplotlib/__init__.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py +index f7f4d53..53216ab 100644 +--- lib/matplotlib/__init__.py ++++ lib/matplotlib/__init__.py +@@ -997,7 +997,7 @@ def _open_file_or_url(fname): + f.close() + else: + fname = os.path.expanduser(fname) +- encoding = locale.getdefaultlocale()[1] ++ encoding = locale.getpreferredencoding(do_setlocale=False) + if encoding is None: + encoding = "utf-8" + with io.open(fname, encoding=encoding) as f: +@@ -1038,7 +1038,8 @@ def _rc_params_in_file(fname, fail_on_error=False): + warnings.warn( + ('Cannot decode configuration file %s with ' + 'encoding %s, check LANG and LC_* variables') +- % (fname, locale.getdefaultlocale()[1] or 'utf-8 (default)')) ++ % (fname, locale.getpreferredencoding(do_setlocale=False) or ++ 'utf-8 (default)')) + raise + + config = RcParams()
participants (1)
-
petr@macports.org