id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
11812 traceback with load and attach of .sage files Marco Streng Jason Grout "When debugging code that is loaded into or attached to a Sage session from a .sage file,
the tracebacks are not very informative: they refer to instead
of to the file name, and give no line numbers or code snippets. This
makes it hard to find out where the error is.
The patch fixes this for attach, but not for load (because of efficiency reasons).
Apply [attachment:11812.3.patch]
----
Example:
Suppose I have some files loaded with ""load"" or ""attach"", and one of them is a .sage file with
{{{
class Bar():
def function_with_common_name(self):
# lots of lines of code
1/0
# lots of lines of code
# other classes that also have functions named function_with_common_name
def foo():
# lots of lines of code
a = Bar()
a.function_with_common_name()
# lots of lines of code
}}}
Now I do
{{{
sage: foo()
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
/home/marco/ in ()
/home/marco/ in foo()
/home/marco/ in function_with_common_name(self)
/usr/local/sage/sage-4.6.2/local/lib/python2.6/site-packages/sage/structure/element.so
in sage.structure.element.RingElement.__div__
(sage/structure/element.c:11981)()
/usr/local/sage/sage-4.6.2/local/lib/python2.6/site-packages/sage/rings/integer.so
in sage.rings.integer.Integer._div_ (sage/rings/integer.c:11944)()
/usr/local/sage/sage-4.6.2/local/lib/python2.6/site-packages/sage/rings/integer_ring.so
in sage.rings.integer_ring.IntegerRing_class._div
(sage/rings/integer_ring.c:5142)()
ZeroDivisionError: Rational division by zero
}}}
Then to find the bug using this traceback, I would need to search my
files to find all functions named ""function_with_common_name"" that are
called from functions named ""foo"" for a line that could cause a division
by zero...
More details:
[http://groups.google.com/group/sage-devel/browse_thread/thread/761f69944e21efd4]
" defect closed major sage-4.8 misc fixed load attach traceback Johan Bosman sage-4.8.alpha0 Marco Streng Johan Bosman N/A