Problem with load in sagemath 9.0 on ubuntu 20.04

46 views
Skip to first unread message

Carl Eberhart

unread,
Oct 19, 2020, 1:36:05 PM10/19/20
to sage-support
I can't load a sage file in either the notebook or terminal version of Sage
Here is my last (of many) attempts.
sage: load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage")             
Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-5-8065d4f608e7>", line 1, in <module>
    load("/home/carl/Notebooks/quadrisection/orthogtraps19.sage")

  File "sage/misc/persist.pyx", line 144, in sage.misc.persist.load (build/cythonized/sage/misc/persist.c:2538)
    sage.repl.load.load(filename, globals())

  File "/usr/lib/python3/dist-packages/sage/repl/load.py", line 272, in load
    exec(preparse_file(f.read()) + "\n", globals)

  File "<string>", line 121
    if s<>_sage_const_0 :
         ^
SyntaxError: invalid syntax

Dima Pasechnik

unread,
Oct 19, 2020, 1:41:00 PM10/19/20
to sage-support
it is certainly possible to create a (broken) Sage file that would not
work. Perhaps it's one of such errors?
Could you reproduce this on a file you are willing to post here?
E.g. something very short, preferably.


>
> --
> 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 sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/33b51a9f-ca07-4c03-9d68-25fb085d6d14n%40googlegroups.com.

Matthias Koeppe

unread,
Oct 19, 2020, 5:15:27 PM10/19/20
to sage-support
On Monday, October 19, 2020 at 10:36:05 AM UTC-7, Carl Eberhart wrote:
I can't load a sage file in either the notebook or terminal version of Sage
  File "<string>", line 121
    if s<>_sage_const_0 :
         ^
SyntaxError: invalid syntax

The syntax <> for "not equal"  is no longer valid in Python 3. Use != instead.

Carl Eberhart

unread,
Oct 20, 2020, 2:57:21 PM10/20/20
to sage-support
Thanks.   After looking for the definition of of preparse_file it appears that it is imported from a binary file.  Will I have to download the source and recompile to fix this?
Carl

Matthias Koeppe

unread,
Oct 20, 2020, 3:02:01 PM10/20/20
to sage-support
On Tuesday, October 20, 2020 at 11:57:21 AM UTC-7, Carl Eberhart wrote:
Thanks.   After looking for the definition of of preparse_file it appears that it is imported from a binary file.  Will I have to download the source and recompile to fix this?

Your code  in orthogtraps19.sage likely contains <> and needs updating.


Carl Eberhart

unread,
Oct 20, 2020, 3:02:35 PM10/20/20
to sage-support
Thanks, but the sage file I am trying to load is one I have loaded many times before on the cloud and also on a local installation of Sagemath 8.6.   It looks like it may be an instance of missing a change from <> to != in the source code of preparse_file.

Carl Eberhart

unread,
Oct 20, 2020, 3:06:51 PM10/20/20
to sage-support
Oh.  Durn.  Thought I had corrected those.  Thanks
Reply all
Reply to author
Forward
0 new messages