ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 15 Apr 2012 10:28:32 +0200Error in looking at source codehttps://ask.sagemath.org/question/8884/error-in-looking-at-source-code/Every so often, I try to look at the source code for some function. It often doesn't work. There is a commonality to the times where it doesn't work. The source code usually has examples in it. And, often there are examples of things that don't work, that cause errors, where the error messages are shown in the source code. It is these examples that seem to cause the problems. The source code prints out up to the error message and then it just stops. Since this happens before it ever gets to the actual source code, I can't see the source code.
The latest source code I tried to view is:
sage.graphs.graph_coloring.all_graph_colorings??
The last thing I see in the source code is:
sage: for C in all_graph_colorings(G,-1): print C
Traceback (click to the left of this block for traceback)
...
I am using Firefox 11 to access Sage on a server, in case that matters. It has been happening for a while, so also it has applied in some previous versions of Firefox as well.
**UPDATE:** I'm just trying to bring more attention to this. It looks to me as though this problem is known but no one seems to be working on it (based on the Trac ticket and the further link to Github in the Trac ticket). I can't even use the workaround mentioned below in the answer (using Sage 4.8 in the notebook), i.e., I'm trying to "click to the left" over and over and nothing ever happens. I'm trying to view the source code for graph coloring and it's just not possible, or I can't figure it out. Now, it's actually worse than I mentioned before. I shift-enter to see the source code. It gets stopped as mentioned above, BUT it's still evaluating something and won't stop. I try to interrupt and it doesn't work. I have to restart the notebook.
**UPDATE 2:** Sorry to bother you, but finally I was able to click to the left and see the code. Not sure what was going on. I was clicking to the left and the result had been (several times) to hide all the output but just have a little gray bar there. Then, clicking a couple more times would bring it back to the form where it stopped at the error.Sun, 15 Apr 2012 00:12:46 +0200https://ask.sagemath.org/question/8884/error-in-looking-at-source-code/Answer by Simon King for <p>Every so often, I try to look at the source code for some function. It often doesn't work. There is a commonality to the times where it doesn't work. The source code usually has examples in it. And, often there are examples of things that don't work, that cause errors, where the error messages are shown in the source code. It is these examples that seem to cause the problems. The source code prints out up to the error message and then it just stops. Since this happens before it ever gets to the actual source code, I can't see the source code.</p>
<p>The latest source code I tried to view is:</p>
<pre><code> sage.graphs.graph_coloring.all_graph_colorings??
</code></pre>
<p>The last thing I see in the source code is:</p>
<pre><code> sage: for C in all_graph_colorings(G,-1): print C
Traceback (click to the left of this block for traceback)
...
</code></pre>
<p>I am using Firefox 11 to access Sage on a server, in case that matters. It has been happening for a while, so also it has applied in some previous versions of Firefox as well.</p>
<p><strong>UPDATE:</strong> I'm just trying to bring more attention to this. It looks to me as though this problem is known but no one seems to be working on it (based on the Trac ticket and the further link to Github in the Trac ticket). I can't even use the workaround mentioned below in the answer (using Sage 4.8 in the notebook), i.e., I'm trying to "click to the left" over and over and nothing ever happens. I'm trying to view the source code for graph coloring and it's just not possible, or I can't figure it out. Now, it's actually worse than I mentioned before. I shift-enter to see the source code. It gets stopped as mentioned above, BUT it's still evaluating something and won't stop. I try to interrupt and it doesn't work. I have to restart the notebook.</p>
<p><strong>UPDATE 2:</strong> Sorry to bother you, but finally I was able to click to the left and see the code. Not sure what was going on. I was clicking to the left and the result had been (several times) to hide all the output but just have a little gray bar there. Then, clicking a couple more times would bring it back to the form where it stopped at the error.</p>
https://ask.sagemath.org/question/8884/error-in-looking-at-source-code/?answer=13460#post-id-13460This is a known problem: See [trac ticket #11913](http://trac.sagemath.org/sage_trac/ticket/11913). Unfortunately, the problem isn't resolved yet.
Two possible workarounds:
1. If you do "click to the left of this block", then the complete source is shown. I don't know what happens if the doc string contains several tracebacks, though.
2. Use the command line version of Sage: The problem is specific to the Notebook.Sun, 15 Apr 2012 05:42:33 +0200https://ask.sagemath.org/question/8884/error-in-looking-at-source-code/?answer=13460#post-id-13460Comment by G-Sage for <p>This is a known problem: See <a href="http://trac.sagemath.org/sage_trac/ticket/11913">trac ticket #11913</a>. Unfortunately, the problem isn't resolved yet.</p>
<p>Two possible workarounds:</p>
<ol>
<li>If you do "click to the left of this block", then the complete source is shown. I don't know what happens if the doc string contains several tracebacks, though.</li>
<li>Use the command line version of Sage: The problem is specific to the Notebook.</li>
</ol>
https://ask.sagemath.org/question/8884/error-in-looking-at-source-code/?comment=19940#post-id-19940I don't use command line. I'm working on a server. But, thanks for the info.Sun, 15 Apr 2012 10:28:32 +0200https://ask.sagemath.org/question/8884/error-in-looking-at-source-code/?comment=19940#post-id-19940