Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade or patch pexpect #8471

Closed
saliola opened this issue Mar 7, 2010 · 6 comments
Closed

Upgrade or patch pexpect #8471

saliola opened this issue Mar 7, 2010 · 6 comments

Comments

@saliola
Copy link

saliola commented Mar 7, 2010

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?

Component: interfaces

Keywords: pexpect

Reviewer: Vincent Delecroix

Issue created by migration from https://trac.sagemath.org/ticket/8471

@saliola
Copy link
Author

saliola commented Mar 10, 2010

comment:1

We discussed this a bit on sage-devel:
http://groups.google.com/group/sage-devel/browse_thread/thread/8213950ab1abbeb2

Some highlights:

  • William Stein pointed out that pexpect was rewritten after 2.0 and has had some performance issues; it is worth trying the latest version of pexpect to see if the situation has improved.

  • Robert Bradshaw pointed out that we need to add a blurb to pexpect's SPKG.txt explaining this issue.

So these should be addressed appropriately by this ticket.

@saliola saliola assigned saliola and unassigned williamstein Mar 10, 2010
@saliola
Copy link
Author

saliola commented May 11, 2010

comment:2

The gap3.py file at #8380 contains a reference to this ticket. When this issues is resolved, the comment in that file should be changed appropriately.

@saliola
Copy link
Author

saliola commented May 11, 2010

Work Issues: address the second comment

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@nexttime
Copy link
Mannequin

nexttime mannequin commented May 7, 2015

comment:8

Duplicate of #10295.

@nexttime nexttime mannequin removed this from the sage-6.4 milestone May 7, 2015
@nexttime nexttime mannequin added the s: needs review label May 7, 2015
@videlec
Copy link
Contributor

videlec commented May 8, 2015

Reviewer: Vincent Delecroix

@videlec
Copy link
Contributor

videlec commented May 8, 2015

Changed work issues from address the second comment to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants