Hi, On Dec 7, 1:40 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Dear Sage-Devels, > > Let me again thank you for the excellent work put in building sage. > > I've found a bug in the most recent release. Specifically, when > invoked with the -notebook switch, the current release does not > properly quote paths. So, if I execute: > > /Applications/sage/sage -notebook "/Users/carson/doc/math/ > sage_notebook/" > > Sage says: > > Traceback (most recent call last): > File "/Applications/sage/local/bin/sage-notebook", line 14, in > <module> > exec "notebook(" + ",".join(sys.argv[1:]) + ")" > File "<string>", line 1 > notebook(/Users/carson/doc/math/sage_notebook/) > ^ > SyntaxError: invalid syntax >
The -notebook command line option takes the same arguments as the notebook() sage command. The directory argument to both the command line option and the sage command should be a python string. So the proper way to write your code is /Applications/sage/sage -notebook '"/Users/carson/doc/math/ sage_notebook/"' Here the outer single quotes ' ' quote the python string "/Users/ carson/doc/math/sage_notebook/". This is a function of your shell. The most recent release of Sage also accepts for example /Applications/sage/sage -notebook '"/Users/carson/doc/math/ sage_notebook/"' secure=True open_viewer=False This did not work for the old release of Sage. > If I edit the offending line in local/bin/sage-notebook: > > exec "notebook(" + ",".join(sys.argv[1:]) + ")" > > To instead read: > > exec "notebook('" + ",".join(sys.argv[1:]) + "')" > > Then the -notebook switch works as expected. Please consider using the > following sage-notebook file to correct this bug: > > http://bentham.k2.t.u-tokyo.ac.jp/media/bugs/sage/sage-notebook > Your code reverts Sage back to the old state. I understand the use of two pairs of quotes is somewhat unintuitive and inconvenient. But it is logical. Kwankyu Lee --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---