Raise TypeError if bufsize argument is not an integer. Patch 1071755, slightly modified.
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 9f7184f..b26d40c 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -394,6 +394,17 @@
         # Subsequent invocations should just return the returncode
         self.assertEqual(p.wait(), 0)
 
+
+    def test_invalid_bufsize(self):
+        # an invalid type of the bufsize argument should raise
+        # TypeError.
+        try:
+            subprocess.Popen([sys.executable, "-c", "pass"], "orange")
+        except TypeError:
+            pass
+        else:
+            self.fail("Expected TypeError")
+
     #
     # POSIX tests
     #