Ignore SIGPIPE when we've opened a pipe
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 7645bfd..204918b 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -571,6 +571,9 @@
 	fp = popen(getstringvalue(name), getstringvalue(mode));
 	if (fp == NULL)
 		return posix_error();
+	/* From now on, ignore SIGPIPE and let the error checking
+	   do the work. */
+	(void) signal(SIGPIPE, SIG_IGN);
 	return newopenfileobject(fp, name, mode, pclose);
 }