One other note, in case anyone encounters this problem:  To pass the 
server_pool option on a BASH command line, one needs to escape the shell 
special characters.  Thus instead of

server_pool=3*['sage@localhost']

one needs

server_pool=3\*\['sage@localhost'\]


On Sunday, January 25, 2015 at 12:46:57 PM UTC-5, mjs wrote:
>
> OK I changed my script to start the notebook from the command line:
>
> #!/bin/bash
> /usr/local/bin/sage --notebook=default \
>        interface = '' port = 34567 secure = True accounts = True \
>        automatic_login = False timeout = 720000 \
>        directory = '/var/www/sage/sage_notebook.sagenb' \
>        server_pool = 3 * ['sage@localhost']
>
> Now the notebook starts and crashes:
>
> $ sage-notebook
> ┌────────────────────────────────────────────────────────────────────┐
> │ Sage Version 6.4.1, Release Date: 2014-11-23                       │
> │ Type "notebook()" for the browser-based notebook interface.        │
> │ Type "help()" for help.                                            │
> └────────────────────────────────────────────────────────────────────┘
> Please wait while the Sage Notebook server starts...
> Traceback (most recent call last):
>   File "/usr/local/sage-6.4.1/src/bin/sage-notebook", line 180, in <module>
>     launcher(unknown)
>   File "/usr/local/sage-6.4.1/src/bin/sage-notebook", line 55, in __init__
>     self.args, self.kwds = self.cmdline2argspec(argv)
>   File "/usr/local/sage-6.4.1/src/bin/sage-notebook", line 51, in 
> cmdline2argspec
>     args.append(value)
> UnboundLocalError: local variable 'value' referenced before assignment
>
> The notebook does start if I don't pass any options to it after the 
> "default", but fails if I include any options at all.
>
>
>
> On Sunday, January 25, 2015 at 7:29:41 AM UTC-5, John Cremona wrote:
>>
>> I am not an expert in this but I start a notebook server from a 
>> one-line bash script and this had to change with sage-6.4.  It now 
>> reads: 
>>
>> /usr/local/bin/sage --notebook default interface='' accounts=True 
>> secure=True automatic_login=False 
>>
>> The "--notebook=default" used not to be needed as there was only one 
>> choice, but now ipython is a valid alternative choice. 
>>
>> Your script can presumably be adapted in a similar way. 
>>
>> John Cremona 
>>
>>
>>
>> On 25 January 2015 at 01:18, mjs <[email protected]> wrote: 
>> > When I start the notebook server from a terminal in Sage, it starts 
>> fine. 
>> > When I start from a script, it fails with the message 
>> > 
>> >         Error, notebook must be one of default, ipython, sagenb but got 
>> None 
>> > 
>> > The script contains 
>> > 
>> >         #!/usr/bin/env /usr/local/bin/sage 
>> >         # 
>> > 
>> >         from sage.all import notebook 
>> > 
>> >         notebook(interface = '', port = 34567, secure = True, accounts 
>> = 
>> > True, 
>> >                  automatic_login = False, 
>> >                  timeout = 720000, 
>> >                  directory = '/var/www/sage/sage_notebook.sagenb', 
>> >                  server_pool = 3 * ['sage@localhost']) 
>> > 
>> > The sage command I enter from the terminal is identical to that last 
>> > notebook() command. 
>> > 
>> > This all worked fine with the script in Sage 6.3, but fails when I 
>> switch to 
>> > Sage 6.4. 
>> > 
>> > The command to start Sage is /usr/local/bin/sage, which is a symlink to 
>> > /usr/local/sage/sage.  In turn, /usr/local/sage is a symlink to either 
>> > /usr/local/sage-6.3 or /usr/local/sage-6.4.1. 
>> > 
>> > Thanks for any help. 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "sage-support" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to [email protected]. 
>> > To post to this group, send email to [email protected]. 
>> > Visit this group at http://groups.google.com/group/sage-support. 
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to