Skip to content

Better interaction with subprocess std[in|out|err] - #297

Merged
tony merged 4 commits into
tmux-python:masterfrom
gil-obradors:master
Oct 25, 2020
Merged

Better interaction with subprocess std[in|out|err]#297
tony merged 4 commits into
tmux-python:masterfrom
gil-obradors:master

Conversation

@gil-obradors

@gil-obradors gil-obradors commented Sep 14, 2020

Copy link
Copy Markdown
Contributor

Needed for interact with big buffer.

Thanks to communicate method implemented with python > 3.
I don't know how to deal with it with python2 ?

https://docs.python.org/3.5/library/subprocess.html#subprocess.Popen.communicate

#251

Official docs:

Warning
Use communicate() rather than .stdin.write, .stdout.read or .stderr.read to avoid deadlocks due to any of the other OS   pipe buffers filling up and blocking the child process. 

@codecov

codecov Bot commented Sep 14, 2020

Copy link
Copy Markdown

Codecov Report

Merging #297 into master will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
- Coverage   87.09%   87.06%   -0.04%     
==========================================
  Files          16       16              
  Lines        1542     1538       -4     
==========================================
- Hits         1343     1339       -4     
  Misses        199      199              
Impacted Files Coverage Δ
libtmux/common.py 86.43% <100.00%> (-0.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5b08a3...a9c17d2. Read the comment docs.

@gil-obradors

Copy link
Copy Markdown
Contributor Author

Official docs says:

Warning
Use communicate() rather than .stdin.write, .stdout.read or .stderr.read to avoid deadlocks due to any of the other OS   pipe buffers filling up and blocking the child process. 

@gil-obradors

Copy link
Copy Markdown
Contributor Author

Is ok in python2 and 3!

@tony
tony merged commit 83eeb9d into tmux-python:master Oct 25, 2020
@tony

tony commented Oct 25, 2020

Copy link
Copy Markdown
Member

@gil-obradors Merged! This will be in 0.8.5

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

Successfully merging this pull request may close these issues.

2 participants