Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
1e51d96
Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module
rhpvorderman Aug 18, 2020
a218c39
Add pipesize parameter for Popen class
rhpvorderman Aug 18, 2020
02b1d43
Add test for F_SETPIPE_SZ and F_GETPIPE_SZ
rhpvorderman Aug 18, 2020
af05503
Ensure cross-platform compatibility for pipesize in subprocess.Popen
rhpvorderman Aug 18, 2020
493d6c3
Add linux test for pipesize in subprocess
rhpvorderman Aug 18, 2020
aad24c6
Enable subprocess pipesize test for all platforms
rhpvorderman Aug 19, 2020
acf9ae4
Do not set pipesizes for Popen on Windows, as this can not be tested …
rhpvorderman Aug 19, 2020
6815aaa
Add F_GETPIPE_SZ, F_SETPIPE_SZ and subprocess.Popen pipesize argument…
rhpvorderman Aug 19, 2020
6bfd6a5
Add Ruben Vorderman to ACKS for work on the pipesize parameter in sub…
rhpvorderman Aug 19, 2020
cf97235
Add blurb for bpo 41586
rhpvorderman Aug 19, 2020
389e4e9
Simplify test fore F_GETPIPE_SZ and F_SETPIPE_SZ so no file cleanup i…
rhpvorderman Aug 19, 2020
e601174
Test F_SETPIPE_SZ and F_GETPIPE_SZ on all supported platforms
rhpvorderman Aug 19, 2020
24f061b
Intentionally exclude fcntl from subprocess.__all__ test.
rhpvorderman Aug 19, 2020
58925f3
Properly format the pipesize argument in the subprocess docs.
rhpvorderman Aug 19, 2020
15b759e
Determine default dynamically
rhpvorderman Aug 24, 2020
d4d0886
Add test for pipesize default
rhpvorderman Aug 24, 2020
c129ca8
Add a note to the documentation about only Linux supporting the pipes…
rhpvorderman Aug 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for pipesize default
  • Loading branch information
rhpvorderman committed Aug 24, 2020
commit d4d08869f71441010dfbf8d9b7d6660249ec4bdf
20 changes: 20 additions & 0 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,26 @@ def test_pipesizes(self):
p.stdin.close()
p.wait()

def test_pipesize_default(self):
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stdin.read(); sys.stdout.write("out");'
' sys.stderr.write("error!")'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
pipesize=-1)
# UNIX tests using fcntl
if sys.platform != "win32" and hasattr(fcntl, "F_GETPIPE_SZ"):
fp_r, fp_w = os.pipe()
default_pipesize = fcntl.fcntl(fp_w, fcntl.F_GETPIPE_SZ)
for fifo in [p.stdin, p.stdout, p.stderr]:
self.assertEqual(
fcntl.fcntl(fifo.fileno(), fcntl.F_GETPIPE_SZ), default_pipesize)
# On other platforms we cannot test the pipe size (yet). But above code
# using pipesize=-1 should not crash.
p.stdin.close()
p.wait()

def test_env(self):
newenv = os.environ.copy()
newenv["FRUIT"] = "orange"
Expand Down