Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#9327 closed defect (fixed)

Bugs in the Simple Sage Server API of sagenb

Reported by: dpoetzsch Owned by: jason, was
Priority: major Milestone: sage-4.6
Component: notebook Keywords: simple twist
Cc: robertwb, jason Merged in: sagenb-0.8.3
Authors: David Poetzsch-Heffter Reviewers: Jason Grout
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by dpoetzsch)

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').

Attachments (2)

simple_api.patch (2.1 KB) - added by dpoetzsch 10 years ago.
The bugfixes mentioned above as a patch file
twist.py (12.2 KB) - added by dpoetzsch 10 years ago.
The new file including the fixes

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by dpoetzsch

  • Description modified (diff)

comment:2 Changed 10 years ago by robertwb

  • Cc robertwb added

comment:3 Changed 10 years ago by jason

Could you post patches or new versions of the affected files? After your fixes, does the simple API seem to work?

The simple API is important for the remote sagetex feature to work.

comment:4 Changed 10 years ago by dpoetzsch

For my purposes the simple API seems to work after applying my fixes (this is logging in, computing stuff, logging out).

Changed 10 years ago by dpoetzsch

The bugfixes mentioned above as a patch file

Changed 10 years ago by dpoetzsch

The new file including the fixes

comment:5 Changed 10 years ago by rlm

  • Milestone set to sage-4.5
  • Status changed from new to needs_review

comment:6 Changed 10 years ago by jason

  • Cc jason added

comment:7 Changed 9 years ago by jason

  • Status changed from needs_review to positive_review

This seems to work great! Remote Sagetex works, for example.

Another ticket would be deleting the verbose output in the server logs anytime something is executed.

comment:8 Changed 9 years ago by mpatel

  • Reviewers set to Jason Grout

comment:9 Changed 9 years ago by mpatel

  • Merged in set to sagenb-0.8.3
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:10 Changed 9 years ago by mpatel

David, could you add yourself to the account name-real name map?

Note: See TracTickets for help on using tickets.