#12565: E = EllipticCurve('10a1') gives a stupid traceback (rather than a smart
one)
-------------------------------+--------------------------------------------
Reporter: was | Owner: cremona
Type: defect | Status: needs_review
Priority: trivial | Milestone: sage-5.0
Component: elliptic curves | Keywords:
Work_issues: | Upstream: N/A
Reviewer: John Cremona | Author: R. Andrew Ohana
Merged: | Dependencies: #12341
-------------------------------+--------------------------------------------
Description changed by rohana:
Old description:
> I don't like this error:
> {{{
> sage: E = EllipticCurve('10a1')
> ---------------------------------------------------------------------------
> AttributeError Traceback (most recent call
> last)
>
> /Users/wstein/sage/install/sage-5.0.beta2/devel/sage-
> git/sage/modular/modsym/padic_lseries/<ipython console> in <module>()
>
> /Users/wstein/sage/install/sage-5.0.beta2/local/lib/python2.7/site-
> packages/sage/schemes/elliptic_curves/constructor.pyc in EllipticCurve(x,
> y, j)
> 293
> 294 if isinstance(x, str):
> --> 295 return ell_rational_field.EllipticCurve_rational_field(x)
> 296
> 297 if rings.is_RingElement(x) and y is None:
>
> /Users/wstein/sage/install/sage-5.0.beta2/local/lib/python2.7/site-
> packages/sage/schemes/elliptic_curves/ell_rational_field.pyc in
> __init__(self, ainvs, extra)
> 197 label = ainvs
> 198 X = sage.databases.cremona.CremonaDatabase()[label]
> --> 199 EllipticCurve_number_field.__init__(self, Q,
> list(X.a_invariants()))
> 200 self.__np = {}
> 201 self.__gens = {}
>
> AttributeError: 'NoneType' object has no attribute 'a_invariants'
> }}}
>
> I would expect something like:
>
> {{{
> ValueError: no known curve with Cremona label '10a1'
> }}}
>
> Another bug. If you use Sage for a level outside the Cremona range and
> you're using a system-wide Sage install, this is the error you get, which
> is pretty scary looking:
> {{{
> sage: E = EllipticCurve('10050000s1')
> Traceback (most recent call last):
> File "/usr/local/share/sage-4.8/local/bin/sage-list-packages", line 21,
> in <module>
> os.makedirs(SAGE_ROOT_TMP)
> File "/usr/local/share/sage-4.8/local/lib/python/os.py", line 157, in
> makedirs
> mkdir(name, mode)
> OSError: [Errno 13] Permission denied: '/usr/local/share/sage-4.8/tmp'
> Using SAGE Server http://www.sagemath.org//packages
>
> Optional package list (shown above) appears to be currently not available
> or corrupted (network error?).
> ---------------------------------------------------------------------------
> AttributeError Traceback (most recent call
> last)
>
> /home/wstein/<ipython console> in <module>()
>
> /usr/local/share/sage-4.8/local/lib/python2.6/site-
> packages/sage/schemes/elliptic_curves/constructor.pyc in EllipticCurve(x,
> y, j)
> 293
> 294 if isinstance(x, str):
> --> 295 return ell_rational_field.EllipticCurve_rational_field(x)
> 296
> 297 if rings.is_RingElement(x) and y is None:
>
> /usr/local/share/sage-4.8/local/lib/python2.6/site-
> packages/sage/schemes/elliptic_curves/ell_rational_field.pyc in
> __init__(self, ainvs, extra)
> 197 label = ainvs
> 198 X = sage.databases.cremona.CremonaDatabase()[label]
> --> 199 EllipticCurve_number_field.__init__(self, Q,
> list(X.a_invariants()))
> 200 self.__np = {}
> 201 self.__gens = {}
>
> AttributeError: 'NoneType' object has no attribute 'a_invariants'
> }}}
New description:
I don't like this error:
{{{
sage: E = EllipticCurve('10a1')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/Users/wstein/sage/install/sage-5.0.beta2/devel/sage-
git/sage/modular/modsym/padic_lseries/<ipython console> in <module>()
/Users/wstein/sage/install/sage-5.0.beta2/local/lib/python2.7/site-
packages/sage/schemes/elliptic_curves/constructor.pyc in EllipticCurve(x,
y, j)
293
294 if isinstance(x, str):
--> 295 return ell_rational_field.EllipticCurve_rational_field(x)
296
297 if rings.is_RingElement(x) and y is None:
/Users/wstein/sage/install/sage-5.0.beta2/local/lib/python2.7/site-
packages/sage/schemes/elliptic_curves/ell_rational_field.pyc in
__init__(self, ainvs, extra)
197 label = ainvs
198 X = sage.databases.cremona.CremonaDatabase()[label]
--> 199 EllipticCurve_number_field.__init__(self, Q,
list(X.a_invariants()))
200 self.__np = {}
201 self.__gens = {}
AttributeError: 'NoneType' object has no attribute 'a_invariants'
}}}
I would expect something like:
{{{
ValueError: no known curve with Cremona label '10a1'
}}}
Another bug. If you use Sage for a level outside the Cremona range and
you're using a system-wide Sage install, this is the error you get, which
is pretty scary looking:
{{{
sage: E = EllipticCurve('10050000s1')
Traceback (most recent call last):
File "/usr/local/share/sage-4.8/local/bin/sage-list-packages", line 21,
in <module>
os.makedirs(SAGE_ROOT_TMP)
File "/usr/local/share/sage-4.8/local/lib/python/os.py", line 157, in
makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/share/sage-4.8/tmp'
Using SAGE Server http://www.sagemath.org//packages
Optional package list (shown above) appears to be currently not available
or corrupted (network error?).
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/wstein/<ipython console> in <module>()
/usr/local/share/sage-4.8/local/lib/python2.6/site-
packages/sage/schemes/elliptic_curves/constructor.pyc in EllipticCurve(x,
y, j)
293
294 if isinstance(x, str):
--> 295 return ell_rational_field.EllipticCurve_rational_field(x)
296
297 if rings.is_RingElement(x) and y is None:
/usr/local/share/sage-4.8/local/lib/python2.6/site-
packages/sage/schemes/elliptic_curves/ell_rational_field.pyc in
__init__(self, ainvs, extra)
197 label = ainvs
198 X = sage.databases.cremona.CremonaDatabase()[label]
--> 199 EllipticCurve_number_field.__init__(self, Q,
list(X.a_invariants()))
200 self.__np = {}
201 self.__gens = {}
AttributeError: 'NoneType' object has no attribute 'a_invariants'
}}}
----
Apply patch at #12341
Apply attachment:trac12565.patch
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12565#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.