[MacPorts] #50717: py27-matplotlib @1.5.1_1: fails to import on OSX 10.7.5

MacPorts noreply at macports.org
Thu Feb 25 13:37:10 PST 2016


#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


More information about the macports-tickets mailing list