#8471: Upgrade or patch pexpect
--------------------------+-------------------------------------------------
Reporter: saliola | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.4
Component: interfaces | Keywords: pexpect
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
Specifying the full path of a command to {{{Expect}}} hits a bug in the
{{{pexpect}}} module shipped with Sage:
{{{
karkwa: which sage
/home/saliola/Applications/bin/sage
karkwa: sage
----------------------------------------------------------------------
| Sage Version 4.3.3, Release Date: 2010-02-21 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: from sage.interfaces.expect import Expect
sage: s = Expect('sage', 'sage> ',
command='/home/saliola/Applications/bin/sage')
sage: s.is_running()
False
sage: s._start()
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call
last)
/home/saliola/Applications/sage-4.3.3/data/extcode/sage/<ipython console>
in <module>()
/home/saliola/Applications/sage-4.3.3/local/lib/python2.6/site-
packages/sage/interfaces/expect.pyc in _start(self, alt_message,
block_during_init)
447 c = 'sage-native-execute ssh %s "nohup sage
-cleaner" &'%self._server
448 os.system(c)
--> 449 self._expect = pexpect.spawn(cmd,
logfile=self.__logfile)
450 if self._do_cleaner():
451 cleaner.cleaner(self._expect.pid, cmd)
/home/saliola/Applications/sage-4.3.3/local/lib/python2.6/site-
packages/pexpect.pyc in __init__(self, command, args, timeout, maxread,
searchwindowsize, logfile)
324 self.command = command
325
--> 326 command_with_path = which(self.command)
327 if command_with_path == None:
328 raise ExceptionPexpect ('The command was not found or
was not executable: %s.' % self.command)
/home/saliola/Applications/sage-4.3.3/local/lib/python2.6/site-
packages/pexpect.pyc in which(filename)
1131 # Special case where filename already contains a path.
1132 if os.path.dirname(filename) != '':
-> 1133 if os.access (filename, os.X_OK) and not os.path.isdir(f):
1134 return filename
1135
UnboundLocalError: local variable 'f' referenced before assignment
sage:
}}}
Note that this is a bug in the {{{pexpect}}} Python module shipped with
Sage.
{{{
sage: import pexpect
sage: pexpect.__version__
'2.0'
}}}
It appears to be fixed in the newest version of {{{pexpect}}} (version
2.3).
Should we patch {{{pexpect}}} or upgrade?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8471>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.