On Dec 23, 2007 11:13 AM, Robert Miller <[EMAIL PROTECTED]> wrote:
>
> Actually, I don't know if matplotlib has anything to do with this
> issue, as:
>
> File "matrix2.pyx", line 2280, in
> sage.matrix.matrix2.Matrix.echelon_form
>     RuntimeError
>
> ImportError: No module named _locale


Just to be clear -- this problem is not some general Darwin problem.  It doesn't
happen on my ppc Darwin machine ( test-fermat.math.harvard.edu-Darwin.txt)
or on my intel 10.4 Dawin machine (test-leibniz.math.harvard.edu-Darwin.txt).
It also does not happen on my intel 10.5.1 Darwin laptop.  So it's probably
something related to how bsd.math.washington.edu is setup.   That said,
looking at the code in

   /Users/was/build/sage-2.9.1.rc2/local/lib/python2.5/locale.py

it looks really stupid, in that it should have a default fallback behavior
of returning "ascii" according to the comments, but is just crashing on
some systems (i.e., bsd.math.washington.edu).    And given that there
is _other_ code in locale.py that looks like this:

try:
    from _locale import *
except ImportError:
    # Locale emulation


I suspect we may be hitting a Python bug, which we should report
to Python.

I've written a simple workaround, and made a new version of the python spkg
which patches locale.py appropriately, and placed the new spkg here:

  http://sage.math.washington.edu/home/was/build/python-2.5.1.p10.spkg

 -- William

Here's the patch I made to locale.py:

bash-3.2$ diff src/Lib/locale.py patches/locale.py
28a29
>     EMULATE = False
32a34
>     EMULATE = True
488c490
< if sys.platform in ('win32', 'darwin', 'mac'):
---
> if not EMULATE and sys.platform in ('win32', 'darwin', 'mac'):



>
>
> On Dec 23, 12:35 pm, Robert Miller <[EMAIL PROTECTED]> wrote:
> > On Dec 23, 12:30 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> >
> > > We *have* to get the new matplotlib package to fully work.  The one we
> > > currently ship is very very out of date.   I will hopefully be able to
> > > work on this tonight if nobody else resolves the problems; what are
> > > they?
> >
> > It seems to be one commonly occuring error (it is all over the Darwin
> > tests)
> > "No module named _locale"
> > e.g.
> >
> > **********************************************************************
> > File "plot.py", line 10:
> >     sage: from pylab import *
> > Exception raised:
> >     Traceback (most recent call last):
> >       File "/Users/was/build/sage-2.9.1.rc2/local/lib/python2.5/
> > doctest.py", line 1212, in __run
> >         compileflags, 1) in test.globs
> >       File "<doctest __main__.example_0[0]>", line 1, in <module>
> >         from pylab import *###line 10:
> >     sage: from pylab import *
> >       File "/Users/was/build/sage-2.9.1.rc2/local/lib/python2.5/site-
> > packages/pylab.py", line 1, in <module>
> >         from matplotlib.pylab import *
> >       File "/Users/was/build/sage-2.9.1.rc2/local/lib/python2.5/site-
> > packages/matplotlib/pylab.py", line 197, in <module>
> >         from cbook import flatten, is_string_like, exception_to_str,
> > popd, \
> >       File "/Users/was/build/sage-2.9.1.rc2/local/lib/python2.5/site-
> > packages/matplotlib/cbook.py", line 18, in <module>
> >         preferredencoding = locale.getpreferredencoding()
> >       File "/Users/was/build/sage-2.9.1.rc2/local/lib/python2.5/
> > locale.py", line 494, in getpreferredencoding
> >         import _locale
> >     ImportError: No module named _locale
> > **********************************************************************
> >
> >
> >
> > > On 12/23/07, Robert Miller <[EMAIL PROTECTED]> wrote:
> >
> > > > There is an rc3, but there are still issues with the new matplotlib
> > > > spkg on Darwin. We may just roll back to what we were using before...
> > > >http://sage.math.washington.edu/home/rlmill/release/sage-2.9.1.rc3/di...
> >
> > > > On Dec 23, 11:08 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> > > > > See attached patch to fix problem below...
> >
> > > > > On Dec 23, 2007 8:52 AM, Robert Miller <[EMAIL PROTECTED]> wrote:
> >
> > > > > > OK, I've fixed the mwrank issues, so const.tex is the only thing 
> > > > > > left.
> > > > > > The error:
> > > > > > sage: show(line([zeta(1/2 + k*I/6) for k in range(180)]),
> > > > > > rgbcolor=(3/4,1/2,5/8))
> >
> > > > ---------------------------------------------------------------------------
> > > > > > <type 'exceptions.TypeError'>             Traceback (most recent 
> > > > > > call
> > > > > > last)
> >
> > > > > > /home/rlmill/release/sage-2.9.1.rc3/<ipython console> in <module>()
> >
> > > > > > /home/rlmill/release/sage-2.9.1.rc3/local/lib/python2.5/site-packages/
> > > > > > sage/plot/plot.py in __call__(self, points, coerce, **kwds)
> > > > > >    1705         if coerce:
> > > > > >    1706             for z in points:
> > > > > > -> 1707                 if len(z) == 3:
> > > > > >    1708                     return self._graphic3d()(points,
> > > > > > coerce=coerce, **kwds)
> > > > > >    1709                 xdata.append(float(z[0]))
> >
> > > > > > <type 'exceptions.TypeError'>: object of type
> > > > > > 'sage.rings.complex_number.ComplexNumber' has no len()
> >
> > > > > > On Dec 23, 10:34 am, Robert Miller <[EMAIL PROTECTED]> wrote:
> > > > > > > Testall on sage.math:
> >
> > > > > > > Following tests failed:
> > > > > > > sage -t  const.tex
> >
> > > > > > > sage -t  devel/sage-main/sage/libs/mwrank/mwrank.pyx
> > > > > > > sage -t  devel/sage-main/sage/libs/mwrank/interface.py
> > > > > > > sage -t  devel/sage-main/sage/schemes/elliptic_curves/
> > > > > > > ell_rational_field.py
> > > > > > > sage -t  devel/sage-main/sage/schemes/elliptic_curves/sha.py
> > > > > > > sage -t  
> > > > > > > devel/sage-main/sage/schemes/elliptic_curves/padic_lseries.py
> > > > > > > sage -t  devel/sage-main/sage/schemes/elliptic_curves/padics.py
> > > > > > > sage -t  
> > > > > > > devel/sage-main/sage/schemes/elliptic_curves/lseries_ell.py
> >
> > > > > > > 'str' object not callable is a common theme to these...
> >
> > > > > --
> > > > > William Stein
> > > > > Associate Professor of Mathematics
> > > > > University of Washingtonhttp://wstein.org
> >
> > > > >  7837.patch
> > > > > 2KDownload
> >
> > > --
> > > William Stein
> > > Associate Professor of Mathematics
> > > University of Washingtonhttp://wstein.org
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to