Changes between Initial Version and Version 6 of Ticket #17044


Ignore:
Timestamp:
09/26/14 16:27:22 (7 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17044

    • Property Status changed from new to needs_review
    • Property Authors changed from to Frédéric Chapoton
    • Property Cc novoselt added
    • Property Branch changed from to u/chapoton/17044
    • Property Commit changed from to 33e6ec3d8d907d3cc04cd90a60db29d414c64a6b
  • Ticket #17044 – Description

    initial v6  
    1 If you install Sage system-wide (e.g., in /usr/local) for all users on your system, most of the pexpect interfaces will be completely massively broken.  The bug is big, but the fix is pretty trivial:
     1If you install Sage system-wide (e.g., in /usr/local) for all users on your system, most of the pexpect interfaces for optional packages will be completely massively broken.  For example, on a system which doesn't have scilab installed:
     2{{{
     3sage: scilab('2+3')
     4---------------------------------------------------------------------------
     5OSError                                   Traceback (most recent call last)
     6<ipython-input-1-c7d52e4ba13e> in <module>()
     7----> 1 scilab('2+3')
    28
    3 {{{
    4 diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
    5 index 4e47d54..ef8a4e1 100644
    6 --- a/src/sage/interfaces/expect.py
    7 +++ b/src/sage/interfaces/expect.py
    8 @@ -127,7 +127,7 @@ class Expect(Interface):
    9      """
    10      def __init__(self, name, prompt, command=None, server=None, server_tmpdir=None,
    11                   ulimit = None, maxread=100000,
    12 -                 script_subdirectory="", restart_on_ctrlc=False,
    13 +                 script_subdirectory=None, restart_on_ctrlc=False,
    14                   verbose_start=False, init_code=[], max_startup_time=None,
    15                   logfile = None, eval_using_file_cutoff=0,
    16                   do_cleaner=True, remote_cleaner=False, path=None,
     9/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __call__(self, x, name)
     10    197
     11    198         if isinstance(x, basestring):
     12--> 199             return cls(self, x, name=name)
     13    200         try:
     14    201             return self._coerce_from_special_method(x)
     15
     16/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in __init__(self, parent, value, is_name, name)
     17   1310         else:
     18   1311             try:
     19-> 1312                 self._name = parent._create(value, name=name)
     20   1313             # Convert ValueError and RuntimeError to TypeError for
     21   1314             # coercion to work properly.
     22
     23/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in _create(self, value, name)
     24    387     def _create(self, value, name=None):
     25    388         name = self._next_var_name() if name is None else name
     26--> 389         self.set(name, value)
     27    390         return name
     28    391
     29
     30/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/scilab.pyc in set(self, var, value)
     31    307         """
     32    308         cmd = '%s=%s;'%(var,value)
     33--> 309         out = self.eval(cmd)
     34    310         if out.find("error") != -1:
     35    311             raise TypeError("Error executing code in Scilab\nCODE:\n\t%s\nScilab ERROR:\n\t%s"%(cmd, out))
     36
     37/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/scilab.pyc in eval(self, command, *args, **kwds)
     38    274             'd  =\n \n    44.'
     39    275         """
     40--> 276         s = Expect.eval(self, command, **kwds).replace("\x1b[?1l\x1b>","").strip()
     41    277         return s
     42    278
     43
     44/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in eval(self, code, strip, synchronize, locals, allow_use_file, split_lines, **kwds)                                                                                                                                                                       
     45   1227                 elif split_lines:
     46   1228                     return '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)
     47-> 1229                                         for L in code.split('\n') if L != ''])
     48   1230                 else:                                                                                                                                           
     49   1231                     return self._eval_line(code, allow_use_file=allow_use_file, **kwds)
     50
     51/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in _eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed)
     52    821         try:
     53    822             if self._expect is None:
     54--> 823                 self._start()
     55    824             E = self._expect
     56    825             try:
     57
     58/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/scilab.pyc in _start(self)
     59    261             sage: scilab._start()                       # optional - scilab
     60    262         """
     61--> 263         Expect._start(self)
     62    264         self.eval("mode(0)")
     63    265
     64
     65/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in _start(self, alt_message, block_during_init)
     66    389         current_path = os.path.abspath('.')
     67    390         dir = self.__path
     68--> 391         sage_makedirs(dir)
     69    392         os.chdir(dir)
     70    393
     71
     72/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/misc/misc.pyc in sage_makedirs(dir)
     73     79     """
     74     80     try:
     75---> 81         os.makedirs(dir)
     76     82     except OSError:
     77     83         if not os.path.isdir(dir):
     78
     79/usr/local/src/sage-git/local/lib/python/os.pyc in makedirs(name, mode)
     80    148     if head and tail and not path.exists(head):
     81    149         try:
     82--> 150             makedirs(head, mode)
     83    151         except OSError, e:
     84    152             # be happy if someone already created the path
     85
     86/usr/local/src/sage-git/local/lib/python/os.pyc in makedirs(name, mode)
     87    155         if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists
     88    156             return
     89--> 157     mkdir(name, mode)
     90    158
     91    159 def removedirs(name):
     92
     93OSError: [Errno 13] Permission denied: '/usr/local/src/sage-git/local/share/sage/ext/scilab'
    1794}}}
    18 
    19 The problem is that elsewhere in the code there is an
    20 {{{
    21 if script_subdirectory is None
    22 }}}
    23 rather than a
    24 {{{
    25 if script_subdirectory
    26 }}}