I’ve been having problem after problem both trying to get this work cross-platform and also with threads.
Why would this fail (on Windows) from within a thread?
self.process = Popen([path.join(self.binaryDir, 'coffee'),
'-c', '-b', '-w', '-o', libDir, srcDir],
shell=False, stdout=PIPE, stderr=PIPE)
Assuming:
self.binaryDir = C:\Users\Joe\AppData\Roaming\npm\coffee
libDir = C:\Users\Joe\Documents\GitHub\CoffeeScript-Sublime-Plugin\lib
srcDir = C:\Users\Joe\Documents\GitHub\CoffeeScript-Sublime-Plugin\src
Error:
Exception in thread Thread-3:
Traceback (most recent call last):
File ".\threading.py", line 532, in __bootstrap_inner
File ".\CoffeeScript.py", line 233, in run
File ".\subprocess.py", line 633, in __init__
File ".\subprocess.py", line 842, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
All of the files exist and I have also tried forward slashes (read that it may work, somewhere). Running the command being passed to Popen works as expected in cmd.
It would be nice if I could just use shell=True and use the system PATH but it’s not possible in this context for whatever reason.
It would also be nice if I could just use which/where outside of the thread to determine the location of the binary automatically. This also is not possible.