Opened 12 years ago
Closed 7 years ago
#8471 closed defect (duplicate)
Upgrade or patch pexpect
Reported by: | saliola | Owned by: | saliola |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | interfaces | Keywords: | pexpect |
Cc: | Merged in: | ||
Authors: | Reviewers: | Vincent Delecroix | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
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?
Change History (10)
comment:1 Changed 12 years ago by
- Owner changed from was to saliola
comment:2 Changed 12 years ago by
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.
comment:3 Changed 12 years ago by
- Work issues set to address the second comment
comment:4 Changed 8 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:5 Changed 8 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:6 Changed 8 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:7 Changed 7 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:8 Changed 7 years ago by
- Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
Duplicate of #10295.
comment:9 Changed 7 years ago by
- Reviewers set to Vincent Delecroix
- Status changed from needs_review to positive_review
- Work issues address the second comment deleted
comment:10 Changed 7 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
We discussed this a bit on sage-devel: http://groups.google.com/group/sage-devel/browse_thread/thread/8213950ab1abbeb2
Some highlights:
So these should be addressed appropriately by this ticket.