ValueError: need more than 2 values to unpack
I get this error for any commands I run.
- Windows 7 Pro 64
- Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
- pip install sarge==0.1.2
Simple run
sarge.run('echo abc')
Trying the test_sarge.py script from repo
PS C:\Users\allan.lei\Desktop> python test_sarge.py
E.EEEEE.E...EEE..EEEEEEEE....EException in thread Thread-3:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 1055, in run_node
result = getattr(self, method)(node, input, async)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 1201, in run_command_node
node.cmd.run(input=input, async=async)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 593, in run
self.process = p = Popen(self.args, **self.kwargs)
File "C:\Python27\lib\subprocess.py", line 701, in __init__
errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 481, in _get_handles
stderr)
ValueError: need more than 2 values to unpack
Exception in thread Thread-4:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 1055, in run_node
result = getattr(self, method)(node, input, async)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 1289, in run_list_node
self.run_node(curr, input, async=use_async)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 1055, in run_node
result = getattr(self, method)(node, input, async)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 1201, in run_command_node
node.cmd.run(input=input, async=async)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 593, in run
self.process = p = Popen(self.args, **self.kwargs)
File "C:\Python27\lib\subprocess.py", line 701, in __init__
errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
File "C:\Python27\lib\site-packages\sarge\__init__.py", line 481, in _get_handles
stderr)
ValueError: need more than 2 values to unpack
Comments (10)
-
repo owner -
reporter Yes. Tried both methods of putting it in the same execution directory and adding to PATH. Also tried
echo abc
from ipython. All work fine. -
repo owner It looks as if Python 2.7.6 changed how the
Popen._get_handles
method works. Do you know if it works with 2.7.5? -
repo owner I have committed a potential fix in changeset 5a4c641. Is it possible for you to install this revision and see if it fixes the problem? I don't have a 2.7.6 installation on Windows which I can test with.
-
reporter Works on the original machine too!
-
repo owner - changed status to resolved
Fixed in changeset 5a4c641.
-
repo owner Issue
#18was marked as a duplicate of this issue. -
I hope a release is made soon so Sarge would be usable to me.
-
repo owner I've just released sarge 0.1.3 on PyPI, which incorporates this fix.
-
Thanks!
- Log in to comment
I can't reproduce this: see the screenshot below.
Did you ensure that
echo.exe
from the GnuWin32coreutils
package is available, as mentioned in the note in the docs here?