[MacPorts] #50717: py27-matplotlib @1.5.1_1: fails to import on OSX 10.7.5
#50717: py27-matplotlib @1.5.1_1: fails to import on OSX 10.7.5 --------------------+--------------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: py-matplotlib --------------------+--------------------------- On an OS X 10.7.5 machine we get a somewhat strange error on `import matplotlib`. Here the traceback: ```
import matplotlib Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1131, in <module> rcParams = rc_params() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8
The strange thing here is that the locale looks reasonable, the same
version just import fine on other OS X versions. Also downgrade to an
earlier version (`py27-matplotlib @1.4.3_0+cairo+tkinter`), the import
just works fine and the problem is gone.
The locale looks reasonable:
import locale locale.getpreferredencoding() 'UTF-8'
Any idea what's going on here?
Is this an upstream issue?
--
Ticket URL: <https://trac.macports.org/ticket/50717>
MacPorts <https://www.macports.org/>
Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import on OSX 10.7.5 ----------------------------+-------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Description changed by petr@…: Old description:
On an OS X 10.7.5 machine we get a somewhat strange error on `import matplotlib`.
Here the traceback: ```
import matplotlib Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1131, in <module> rcParams = rc_params() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8
The strange thing here is that the locale looks reasonable, the same version just import fine on other OS X versions. Also downgrade to an earlier version (`py27-matplotlib @1.4.3_0+cairo+tkinter`), the import just works fine and the problem is gone.
The locale looks reasonable:
```
import locale locale.getpreferredencoding() 'UTF-8'
Any idea what's going on here? Is this an upstream issue?
New description: On an OS X 10.7.5 machine we get a somewhat strange error on `import matplotlib`. Here the traceback: {{{
import matplotlib Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1131, in <module> rcParams = rc_params() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8
}}}
The strange thing here is that the locale looks reasonable, the same version just importa fine on other OS X versions. Also after downgrade to an earlier version (`py27-matplotlib @1.4.3_0+cairo+tkinter`), the import just works fine and the problem is gone. The locale looks reasonable: {{{
import locale locale.getpreferredencoding() 'UTF-8' )))
Any idea what's going on here? Is this an upstream issue? -- -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import on OSX 10.7.5 ----------------------------+-------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Comment (by petr@…): Looks like this was already address [https://github.com/matplotlib/matplotlib/pull/5931 upstream] and should be solved in 1.5.2. -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Changes (by mojca@…): * keywords: => haspatch * cc: mojca@… (added) * version: 2.3.4 => Comment: We could simply [https://github.com/matplotlib/matplotlib/commit/2ac494f71676e8cf824ae7eced1b... apply the upstream patch] until the new version gets released. I didn't try to recompile the patched package yet, but the problem can be reproduced with {{{ $ export LC_ALL=UTF-8 $ /opt/local/bin/python2.7
import matplotlib }}} and hopefully fixed after the patch.
-- Ticket URL: <https://trac.macports.org/ticket/50717#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Comment (by sean@…): Should we apply the patch then? -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Comment (by petr@…): I am in favor of applying the patch, as it would fix the problem for users immediately. -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Changes (by petr@…): * cc: gaia.soldati@… (added) -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Comment (by mojca@…): Sean, can you please commit this? I happily do it myself (I just run "svn ci"), but I would prefer your blessing. -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:7> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Comment (by petr@…): r147515 applies this patch. I just added a revision bump. -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:8> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Comment (by petr@…): @mojca @sean: I already applied this because it caused issues for quite some people. Hope that is okay. -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:9> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Changes (by petr@…): * status: new => closed * resolution: => fixed -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:10> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Comment (by mojca@…): Thank you. I didn't try to update in the last hour. I noticed you made a change in the ticket, but didn't check the sources. -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:11> MacPorts <https://www.macports.org/> Ports system for OS X
#50717: py27-matplotlib @1.5.1_1: fails to import when locale is set to just `UTF-8` ----------------------------+---------------------- Reporter: petr@… | Owner: sean@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: haspatch Port: py-matplotlib | ----------------------------+---------------------- Comment (by sean@…): Yeah, if I'm not responding (as in this case), it usually means I'm traveling. So, please feel free to apply any patches :-) -- Ticket URL: <https://trac.macports.org/ticket/50717#comment:12> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts