#8556: simple server API broken
------------------------+---------------------------------------------------
   Reporter:  jason     |       Owner:  was       
       Type:  defect    |      Status:  new       
   Priority:  major     |   Milestone:  sage-4.3.4
  Component:  notebook  |    Keywords:            
     Author:            |    Upstream:  N/A       
   Reviewer:            |      Merged:            
Work_issues:            |  
------------------------+---------------------------------------------------
 When I try to access Sage using the Simple API, I get failures, even
 though apparently doctests pass in the file.

 Here is the server transcript:
 {{{
 $ sage
 ----------------------------------------------------------------------
 | Sage Version 4.3.3, Release Date: 2010-02-21                       |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 sage: notebook()
 The notebook files are stored in: sage_notebook.sagenb
 Removing stale pidfile sage_notebook.sagenb/twistd.pid
 **************************************************
 *                                                *
 * Open your web browser to http://localhost:8000 *
 *                                                *
 **************************************************
 2010-03-18 00:05:32-0600 [-] Log opened.
 2010-03-18 00:05:32-0600 [-] twistd 8.2.0
 (/home/grout/sage/local/bin/python 2.6.4) starting up.
 2010-03-18 00:05:32-0600 [-] reactor class:
 twisted.internet.selectreactor.SelectReactor.
 2010-03-18 00:05:32-0600 [-] twisted.web2.channel.http.HTTPFactory
 starting on 8000
 2010-03-18 00:05:32-0600 [-] Starting factory
 <twisted.web2.channel.http.HTTPFactory instance at 0xb8340ac>
 2010-03-18 00:06:01-0600 [HTTPChannel,6,127.0.0.1] Exception rendering:
 2010-03-18 00:06:01-0600 [HTTPChannel,6,127.0.0.1] Unhandled Error
     Traceback (most recent call last):
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/internet/defer.py", line 186, in addCallbacks
         self._runCallbacks()
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/internet/defer.py", line 328, in _runCallbacks
         self.result = callback(self.result, *args, **kw)
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/internet/defer.py", line 289, in _continue
         self.unpause()
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/internet/defer.py", line 285, in unpause
         self._runCallbacks()
     --- <exception caught here> ---
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/internet/defer.py", line 328, in _runCallbacks
         self.result = callback(self.result, *args, **kw)
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/web2/server.py", line 296, in <lambda>
         d.addCallback(lambda res, req: res.renderHTTP(req), self)
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/web2/resource.py", line 85, in renderHTTP
         return method(request)
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/web2/resource.py", line 202, in http_GET
         return super(Resource, self).http_GET(request)
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/twisted/web2/resource.py", line 128, in http_GET
         return self.render(request)
       File "/home/grout/sage/local/lib/python2.6/site-
 packages/sagenb-0.7.5.1-py2.6.egg/sagenb/simple/twist.py", line 205, in
 render
         U = notebook_twist.notebook.user(username)
     exceptions.AttributeError: 'NoneType' object has no attribute 'user'

 }}}


 Here is the client transcript, copied almost verbatim from the doctests in
 simple.py:

 {{{
 In [1]: import urllib, re

 In [2]: def get_url(url): h = urllib.urlopen(url); data = h.read();
 h.close(); return data
    ...:

 In [3]: login_page =
 get_url('http://localhost:8000/simple/login?username=admin&password=<DELETED>')

 In [4]: print login_page
 ------> print(login_page)
 <html><head><title>Internal Server Error</title></head><body><h1>Internal
 Server Error</h1>An error occurred rendering the requested page. More
 information is available in the server log.</body></html>
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8556>
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.

Reply via email to