#13154: Bug on Sage simple server
----------------------------+-----------------------------------------------
Reporter: ares | Owner: Ares Ribó
Type: defect | Status: new
Priority: major | Milestone: sage-5.1
Component: notebook | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
----------------------------+-----------------------------------------------
Changes (by kcrisman):
* cc: jason (added)
* author: Jordi Saludes =>
Old description:
> ''We have the following problems:''[[BR]]
>
> nb = test_notebook(passwd, secure=False, address='localhost', port=port,
> verbose=True)
> bash-3.2$ sage[[BR]]
>
> ----------------------------------------------------------------------[[BR]]
>
> | Sage Version 5.0.1, Release Date: 2012-06-10
> |[[BR]]
>
> | Type notebook() for the GUI, and license() for information.
> |[[BR]]
>
> ----------------------------------------------------------------------[[BR]]
>
> Loading Sage library. Current Mercurial branch is: d6.2 [[BR]]
>
> sage: from sage.server.misc import find_next_available_port [[BR]]
>
> sage: port = find_next_available_port(9000, verbose=False) [[BR]]
>
> sage: from sagenb.notebook.notebook_object import test_notebook [[BR]]
>
> sage: passwd = str(randint(1,1<<128)) [[BR]]
>
> sage: nb = test_notebook(passwd, secure=False, address='localhost',
> port=port, verbose=True) [[BR]]
>
> ---------------------------------------------------------------------------
> [[BR]]
>
> TypeError Traceback (most recent call
> last) [[BR]]
>
> /Applications/sage/<ipython console> in <module>()
>
> TypeError: test_notebook() got an unexpected keyword argument 'address'
>
> ''This is the first error. It seems that `address` is not currently (in
> 5.0.1) a valid option.
> Must update the docs.
> ''
> [[BR]]
> [[BR]]
> [[BR]]
>
>
> sage: nb = test_notebook(passwd, secure=False, port=port, verbose=True)
>
> Notebook started.
>
> sage: import urllib, re
>
> sage: def get_url(url): h = urllib.urlopen(url); data = h.read();
> h.close(); return data
>
> ....:
>
> sage: sleep(1)
>
> sage: login_page =
> get_url('http://localhost:%s/simple/login?username=admin&password=%s' %
> (port,
>
> passwd))
>
> sage: print login_page
>
> {
>
> "session": "fcee333f07d53c13a46f65b9c4a15473"
>
> }
>
> ___S_A_G_E___
>
> sage: session = re.match(r'.*"session": "([^"]*)"', login_page,
> re.DOTALL).groups()[0]
>
> sage: sleep(0.5)
>
> sage: print
> get_url('http://localhost:%s/simple/compute?session=%s&code=2*2&timeout=60'
> % (port,
>
> session))
>
> {
>
> "status": "done",
>
> "files": [],
>
> "cell_id": 2
>
> }
>
> ___S_A_G_E___
>
> 4
> ''
> Just repeating this command 3 times, it gets stuck.''
New description:
''We have the following problems:''[[BR]]
{{{
nb = test_notebook(passwd, secure=False, address='localhost', port=port,
verbose=True)
bash-3.2$ sage
----------------------------------------------------------------------[[BR]]
| Sage Version 5.0.1, Release Date: 2012-06-10
|[[BR]]
| Type notebook() for the GUI, and license() for information.
|[[BR]]
----------------------------------------------------------------------[[BR]]
Loading Sage library. Current Mercurial branch is: d6.2 [[BR]]
sage: from sage.server.misc import find_next_available_port [[BR]]
sage: port = find_next_available_port(9000, verbose=False) [[BR]]
sage: from sagenb.notebook.notebook_object import test_notebook [[BR]]
sage: passwd = str(randint(1,1<<128)) [[BR]]
sage: nb = test_notebook(passwd, secure=False, address='localhost',
port=port, verbose=True) [[BR]]
---------------------------------------------------------------------------
[[BR]]
TypeError Traceback (most recent call
last) [[BR]]
/Applications/sage/<ipython console> in <module>()
TypeError: test_notebook() got an unexpected keyword argument 'address'
''This is the first error. It seems that `address` is not currently (in
5.0.1) a valid option.
Must update the docs.
''
[[BR]]
[[BR]]
[[BR]]
sage: nb = test_notebook(passwd, secure=False, port=port, verbose=True)
Notebook started.
sage: import urllib, re
sage: def get_url(url): h = urllib.urlopen(url); data = h.read();
h.close(); return data
....:
sage: sleep(1)
sage: login_page =
get_url('http://localhost:%s/simple/login?username=admin&password=%s' %
(port,
passwd))
sage: print login_page
{
"session": "fcee333f07d53c13a46f65b9c4a15473"
}
___S_A_G_E___
sage: session = re.match(r'.*"session": "([^"]*)"', login_page,
re.DOTALL).groups()[0]
sage: sleep(0.5)
sage: print
get_url('http://localhost:%s/simple/compute?session=%s&code=2*2&timeout=60'
% (port,
session))
{
"status": "done",
"files": [],
"cell_id": 2
}
___S_A_G_E___
4
}}}
''
Just repeating this command 3 times, it gets stuck.''
--
Comment:
If I'm not mistaken, the Sage simple server is more or less deprecated.
The [https://github.com/sagemath/sagecell/ Sage cell server] seems to be
along the lines of replacing it. Jason, is that correct?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13154#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.