amitt001 / delegator.py

Subprocesses for Humans 2.0.
MIT License
1.7k stars 92 forks source link

delegator.chain() adds an extra newline into pipes #57

Closed LucidOne closed 5 years ago

LucidOne commented 6 years ago

Expected results

$ seq 4 | awk '{ print $0 " test"; }'
1 test
2 test
3 test
4 test

Actual results

$ python test.py 
1 test
2 test
3 test
4 test
 test

test.py

#!/usr/bin/env python
import delegator
c = delegator.chain("seq 4 | awk '{ print $0 \" test\"; }'")
print(c.out)

If I substitute delegator.run() for delegator.chain() it works correctly. Tested with v0.1.0, seems to happen in both python2 and 3

ParthS007 commented 5 years ago

Closing due to inactivity :+1: