Piping fails on `sh` 2.0.x
anatoly-scherbakov opened this issue · comments
Testing the following example from the documentation:
wc(ls("/etc", "-1"), "-l")
gives a crash on every version ⩾ 2.0.0:
(jeeves-shell) anatoly@anatoly-laptop:~/research/jeeves-shell$ pip freeze | grep 'sh='
sh==2.0.4
(jeeves-shell) anatoly@anatoly-laptop:~/research/jeeves-shell$ python
Python 3.10.8 (main, Nov 27 2022, 11:45:09) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sh import wc, ls
>>> wc(ls("/etc", "-1"), "-l")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 1524, in __call__
rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 750, in __init__
self.wait()
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 812, in wait
self.handle_command_exit_code(exit_code)
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 839, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/bin/wc 'acpi
adduser.conf
…
xml
zsh_command_not_found
' -l
STDOUT:
STDERR:
/usr/bin/wc: 'acpi'$'\n''ad… (3081 more, please see e.stderr)
It works as intended on 1.14.3.
The documentation is not current with 2.0.0
…On Fri, May 19, 2023, 10:08 AM Anatoly Scherbakov ***@***.***> wrote:
Testing the following example from the documentation:
wc(ls("/etc", "-1"), "-l")
gives a crash on every version ⩾ 2.0.0:
(jeeves-shell) ***@***.***:~/research/jeeves-shell$ pip freeze | grep 'sh='
sh==2.0.4
(jeeves-shell) ***@***.***:~/research/jeeves-shell$ python
Python 3.10.8 (main, Nov 27 2022, 11:45:09) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sh import wc, ls
>>> wc(ls("/etc", "-1"), "-l")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 1524, in __call__
rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 750, in __init__
self.wait()
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 812, in wait
self.handle_command_exit_code(exit_code)
File "/home/anatoly/.pyenv/versions/jeeves-shell/lib/python3.10/site-packages/sh.py", line 839, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/bin/wc 'acpi
adduser.conf
…
xml
zsh_command_not_found
' -l
STDOUT:
STDERR:
/usr/bin/wc: 'acpi'$'\n''ad… (3081 more, please see e.stderr)
It works as intended on 1.14.3.
—
Reply to this email directly, view it on GitHub
<#677>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB7IKO3LSGUTUBUGAGM373XG6SJTANCNFSM6AAAAAAYIA2SP4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Closing as duplicate of #656