run dir, cd commands in windows

28 views
Skip to first unread message

Robert Smith

unread,
Oct 1, 2015, 9:58:13 PM10/1/15
to sarge
Sarge works extremely well when running commands through bash in Windows. Unfortunately, I'm not able to run, for example, sarge.run('dir') or sarge.run('cd'). In a new conda environment. Instead, I'm getting this traceback:

>>> import sarge
>>> sarge.run('dir')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda\envs\new-sarge-env\lib\site-packages\sarge\__init__.py", lin
e 1411, in run
    p.run(input=input, async=async)
  File "C:\Anaconda\envs\new-sarge-env\lib\site-packages\sarge\__init__.py", lin
e 1040, in run
    self.run_node(node, input=input, async=async)
  File "C:\Anaconda\envs\new-sarge-env\lib\site-packages\sarge\__init__.py", lin
e 1136, in run_node
    result = getattr(self, method)(node, input, async)
  File "C:\Anaconda\envs\new-sarge-env\lib\site-packages\sarge\__init__.py", lin
e 1282, in run_command_node
    node.cmd.run(input=input, async=async)
  File "C:\Anaconda\envs\new-sarge-env\lib\site-packages\sarge\__init__.py", lin
e 632, in run
    self.process = p = Popen(self.args, **self.kwargs)
  File "C:\Anaconda\envs\new-sarge-env\lib\subprocess.py", line 710, in __init__

    errread, errwrite)
  File "C:\Anaconda\envs\new-sarge-env\lib\subprocess.py", line 958, in _execute
_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
>>>

Other commands run without problem (such as sarge.run('tasklist')). Is there something wrong with my conda environment?

Thanks.

Vinay Sajip

unread,
Oct 2, 2015, 12:22:21 PM10/2/15
to python...@googlegroups.com
No, it's because those are not external commands but shell builtins - built into cmd.exe.

Regards,

Vinay Sajip


From: Robert Smith <rsmit...@gmail.com>
To: sarge <python...@googlegroups.com>
Sent: Friday, 2 October 2015, 2:58
Subject: run dir, cd commands in windows

--
You received this message because you are subscribed to the Google Groups "sarge" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-sarge...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Robert Smith

unread,
Oct 4, 2015, 12:27:15 AM10/4/15
to sarge, vinay...@yahoo.co.uk
Good to know. Thanks
Reply all
Reply to author
Forward
0 new messages