Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interactive acts different when stdin is pipe rather than from user #17

Open
adamdoupe opened this issue Apr 18, 2019 · 1 comment
Open

Comments

@adamdoupe
Copy link

Test cases:
https://gist.github.com/adamdoupe/fa53c586c2bab357e0a97a524a865240

repro:

run python server.py

then run:

python -c "print('hello\n')" | python test.py

expected output from test.py:

hello

received output from test.py:

@rhelmot
Copy link
Owner

rhelmot commented Apr 22, 2019

What's happening is that this is equivalent to entering hello and then pressing ctrl-d before the server has a chance to reply.

Normal netcat doesn't take any action on ctrl-d - it only terminates when the socket dies. I'm not sure if this is behavior I want to replicate though..?

You perhaps want nc.recvall().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants