3.4.1.alpha0 notebook traceback doesn't work

2 views
Skip to first unread message

Ondrej Certik

unread,
Apr 3, 2009, 3:42:29 AM4/3/09
to sage-...@googlegroups.com
Hi,

If I use the notebook in Python only mode with 3.4.1.alpha0, and if
there is any exception, I always get:


Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/code/26.py",
line 6, in <module>
print _support_.syseval(python, ur'''from
sympy.printing.pretty.stringpict import stringPict''',
'/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/cells/8')
File "/home/ondrej/ext/sage-3.4.1.alpha0/local/lib/python2.5/site-packages/sage/server/support.py",
line 353, in syseval
return system.eval(cmd, sage_globals, locals = sage_globals)
AttributeError: 'function' object has no attribute 'eval'


no matter which exception was raised, which imho is some bug in the
notebook, isn't it? I would expect some traceback. I think it's
related to:

http://trac.sagemath.org/sage_trac/ticket/5282


Ondrej

William Stein

unread,
Apr 3, 2009, 10:24:49 AM4/3/09
to sage-...@googlegroups.com
On Fri, Apr 3, 2009 at 12:42 AM, Ondrej Certik <ond...@certik.cz> wrote:
>
> Hi,
>
> If I use the notebook in Python only mode with 3.4.1.alpha0, and if
> there is any exception, I always get:
>
>
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/code/26.py",
> line 6, in <module>
>    print _support_.syseval(python, ur'''from
> sympy.printing.pretty.stringpict import stringPict''',
> '/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/cells/8')
>  File "/home/ondrej/ext/sage-3.4.1.alpha0/local/lib/python2.5/site-packages/sage/server/support.py",
> line 353, in syseval
>    return system.eval(cmd, sage_globals, locals = sage_globals)
> AttributeError: 'function' object has no attribute 'eval'
>
>
> no matter which exception was raised, which imho is some bug in the
> notebook, isn't it?

I can't replicate this. I've attached a little screenshot of me using
sage-3.4.1.alpha0 in
python mode, and I don't get AttributeError's.

William


> I would expect some traceback. I think it's
> related to:
>
> http://trac.sagemath.org/sage_trac/ticket/5282
>
>
> Ondrej
>
> >
>



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

Ondrej Certik

unread,
Apr 3, 2009, 10:54:36 AM4/3/09
to sage-...@googlegroups.com
On Fri, Apr 3, 2009 at 7:24 AM, William Stein <wst...@gmail.com> wrote:
> On Fri, Apr 3, 2009 at 12:42 AM, Ondrej Certik <ond...@certik.cz> wrote:
>>
>> Hi,
>>
>> If I use the notebook in Python only mode with 3.4.1.alpha0, and if
>> there is any exception, I always get:
>>
>>
>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>>  File "/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/code/26.py",
>> line 6, in <module>
>>    print _support_.syseval(python, ur'''from
>> sympy.printing.pretty.stringpict import stringPict''',
>> '/home/ondrej/.sage/sage_notebook/worksheets/ondrej/0/cells/8')
>>  File "/home/ondrej/ext/sage-3.4.1.alpha0/local/lib/python2.5/site-packages/sage/server/support.py",
>> line 353, in syseval
>>    return system.eval(cmd, sage_globals, locals = sage_globals)
>> AttributeError: 'function' object has no attribute 'eval'
>>
>>
>> no matter which exception was raised, which imho is some bug in the
>> notebook, isn't it?
>
> I can't replicate this.  I've attached a little screenshot of me using
> sage-3.4.1.alpha0 in
> python mode, and I don't get AttributeError's.

I can't replicate it either anymore in a *new* worksheet. It's the
same sage instance, I kept it running over the night. However, in my
old worksheet, it still behaves the wrong way, screenshot attached.

I guess I just restart the worksheet and that will fix it, but then I
won't be able to reproduce it anymore.

Ondrej

traceback.png

William Stein

unread,
Apr 3, 2009, 11:04:28 AM4/3/09
to sage-...@googlegroups.com

Maybe you did something "stupid". E.g., if you do

python = lambda x: x^2

in an input cell, then you'll suddenly get the error you reported in
this thread.

William

Ondrej Certik

unread,
Apr 3, 2009, 11:11:43 AM4/3/09
to sage-...@googlegroups.com

You can see all the things I did in the screenshot. Ah, ok, I can see it now --

from sympy import *

imports "python":


In [1]: python?
Type: function
Base Class: <type 'function'>
String Form: <function python at 0x2d81848>
Namespace: Interactive
File: /home/ondrej/repos/sympy/sympy/printing/python.py
Definition: python(expr)
Docstring:
Return Python interpretation of passed expression
(can be passed to the exec() function without any modifications)


So that explains it. I didn't know I cannot use the word "python". We
should rename it anyway.

Ondrej

Brian Granger

unread,
Apr 7, 2009, 2:03:07 PM4/7/09
to sage-...@googlegroups.com
I just independently found this bug (I just posted to the list). The
problem seems to be with the line:

from sympy import *

line that both of us are using in python mode.

Brian
Reply all
Reply to author
Forward
0 new messages