#9327: Bugs in the Simple Sage Server API of sagenb
--------------------------------------+-------------------------------------
Reporter: dpoetzsch | Owner: jason, was
Type: defect | Status: new
Priority: major | Milestone:
Component: notebook | Keywords: simple twist
Author: David Poetzsch-Heffter | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------------+-------------------------------------
Description changed by dpoetzsch:
Old description:
> I found (and fixed) the following bugs in the file local/lib/python2.6
> /site-packages/sagenb-0.8-py2.6.egg/sagenb/simple/twist.py:
>
> * When trying to login via the Simple Sage Server API using the
> sagenb.notebook.notebook_object module the following error came up:
> ....
> /sagenb-0.8-py2.6.egg/sagenb/simple/twist.py, line 206, in render
> U = notebook_twist.notebook.user(username)
> exceptions.AttributeError: 'NoneType' object has no attribute 'user'
> --------------------------------------------------------------------
> The problem is: The sagenb twist.py module still imports the (old and
> unmaintained) sage.server modules instead of the new sagenb files. It is
> quite logical that there is a NoneType error because there is no server
> started that relies on the (imported) old files.
> If the two imports from sage.server in twist.py are replaced with the
> sagenb modules at least the login via Simple Sage Server API works quite
> fine.
>
> * When login works there is another bug: On line 286 in the twist.py file
> where it says "return http.Response(..." the stream variable has to be
> converted into a string (twisted somehow seems to have problems with
> unicode characters because IByteStream(stream) which is called in
> http.Response() fails with a TypeError if stream is of type 'unicode').
New description:
I found (and fixed) the following bugs in the file local/lib/python2.6
/site-packages/sagenb-0.8-py2.6.egg/sagenb/simple/twist.py:
* When trying to login via the Simple Sage Server API using the
sagenb.notebook.notebook_object module the following error came up:
{{{
....
/sagenb-0.8-py2.6.egg/sagenb/simple/twist.py, line 206, in render
U = notebook_twist.notebook.user(username)
exceptions.AttributeError: 'NoneType' object has no attribute 'user'
}}}
The problem is: The sagenb twist.py module still imports the (old and
unmaintained) sage.server modules instead of the new sagenb files. It is
quite logical that there is a NoneType error because there is no server
started that relies on the (imported) old files.
If the two imports from sage.server in twist.py are replaced with the
sagenb modules at least the login via Simple Sage Server API works quite
fine.
* When login works there is another bug: On line 286 in the twist.py file
where it says "return http.Response(..." the stream variable has to be
converted into a string (twisted somehow seems to have problems with
unicode characters because IByteStream(stream) which is called in
http.Response() fails with a TypeError if stream is of type 'unicode').
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9327#comment:1>
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.