Question mark failed on Sage toplevel

69 views
Skip to first unread message

François Colas

unread,
Jun 8, 2015, 9:01:52 AM6/8/15
to sage-s...@googlegroups.com
Hello everyone,

I'm facing an error with the question mark after any kind of function. Here is an error log with 'PolynomialRing' : https://gist.github.com/anonymous/f9adbc3ec08dac0892a6

I cannot access the documentation with '?' but it works with :

sage: help(PolynomialRing)

I'm running Manjaro Linux (an arch-based distribution) with these packages installed :

- community/sagemath 6.7-1
- extra/python2 2.7.10-1
- community/ipython2 3.1.0-1

Everything used to work before some updates... (Sage 6.6 -> 6.7?)

Any ideas on how I could fix that?

Dominique Laurain

unread,
Jun 8, 2015, 4:26:32 PM6/8/15
to sage-s...@googlegroups.com
Bonsoir Francois,

Je ne peux rien dire de certain pour une version sagemath installé en local (car je n'ai rien sur mon PC)...mais sur le cloud de SAGE cela fonctionne.

URL site web : https://cloud.sagemath.com
Dans un projet ouvrir un "terminal" puis exécuter les commandes en fin de ce post

Le début de pile que tu as mis dans gistub est conforme a ce que je lis dans le cloud de sage...et au niveau du dernier module qui se trouve sur le cloud dans le fichier (souce non compile Python):

/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/misc/sagedoc.py

que le module conf.py est chargé par import :  SAGE_DOC/common/conf.py
où SAGE_DOC est une variable d'environnement de type chaine  définit dans sage.env

from sage.env import SAGE_DOC, SAGE_SRC

Sous le cloud dans un terminal, si j'execute en ligne commande :  sage
puis import sage.env
et enfin    env SAGE_DOC
cela retourne pour moi

sage: env SAGE_DOC
'/projects/sage/sage-6.7/src/doc'

Je suppose que dans votre environnement c'est cette variable SAGE_DOC qui est mal positionnée...rendant indisponible le module python conf .... A voir.

Dominique




$ sage
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's writable by an untrusted group.
Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar
exploits, you should not execute Python code from this directory
┌────────────────────────────────────────────────────────────────────┐
│ SageMath Version 6.7, Release Date: 2015-05-17                     │
│ Enhanced for SageMathCloud.                                        │
└────────────────────────────────────────────────────────────────────┘
sage: help(PolynomialRing)
 
sage: ?PolynomialRing
/projects/sage/sage-6.7/local/lib/python2.7/site-packages/setuptools-12.4-py2.7.egg/pkg_resources/__init__.py:1224: UserWarning: /project
s/6429970e-5a78-4aee-a6b1-af1e80542481/.sage//.python-eggs is writable by group/others and vulnerable to attack when used with get_resour
ce_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).


William Stein

unread,
Jun 8, 2015, 4:29:21 PM6/8/15
to sage-support
Hi François,

This is definitely a bug in SageMathCloud, which might be related to a
bug in Sage itself (not sure). Can you open a ticket at

https://github.com/sagemathinc/smc/issues

William
> --
> 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 post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

Volker Braun

unread,
Jun 8, 2015, 6:11:52 PM6/8/15
to sage-s...@googlegroups.com
You have a file named "conf.py" in the current working directory. A workaround is to start Sage in a different directory.

Volker Braun

unread,
Jun 8, 2015, 6:17:17 PM6/8/15
to sage-s...@googlegroups.com

François Colas

unread,
Jun 8, 2015, 6:51:18 PM6/8/15
to sage-s...@googlegroups.com
Dominique gave the right hint because the folder in the env variable didn't exist:

sage: env SAGE_DOC
'/usr/share/doc/sage'

The problem is solved by installing the package 'community/sagemath-doc 6.7-1' (on Manjaro Linux) and we can check:

$ ls /usr/share/doc/sage/
ca/  common/  de/  en/  fr/  hu/  it/  output/  pt/  ru/  tr/

Now the question mark works again but as Volker noticed if you have a "conf.py" file in your working directory you will get an error.

Thank you!

Dominique Laurain

unread,
Jun 9, 2015, 1:46:34 PM6/9/15
to sage-s...@googlegroups.com

You're welcome Francois

Bienvenue Francois.

Maybe you can "complete" the thread...no worry... Volker or William will fix that later ...:-)
Reply all
Reply to author
Forward
0 new messages