Export function sanitize_the_mode from fileobject.c as _PyFile_SanitizeMode().  Use this function in posixmodule.c when implementing fdopen().  This fixes test_subprocess.py for a VisualStudio 2005 compile.
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 1880187..ac093ce 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -139,17 +139,16 @@
    ignore stuff they don't understand... write or append mode with
    universal newline support is expressly forbidden by PEP 278.
    Additionally, remove the 'U' from the mode string as platforms
-   won't know what it is. */
-/* zero return is kewl - one is un-kewl */
-static int
-sanitize_the_mode(char *mode)
+   won't know what it is. Non-zero return signals an exception */
+int
+_PyFile_SanitizeMode(char *mode)
 {
 	char *upos;
 	size_t len = strlen(mode);
 
 	if (!len) {
 		PyErr_SetString(PyExc_ValueError, "empty mode string");
-		return 1;
+		return -1;
 	}
 
 	upos = strchr(mode, 'U');
@@ -160,7 +159,7 @@
 			PyErr_Format(PyExc_ValueError, "universal newline "
 			             "mode can only be used with modes "
 				     "starting with 'r'");
-			return 1;
+			return -1;
 		}
 
 		if (mode[0] != 'r') {
@@ -175,7 +174,7 @@
 	} else if (mode[0] != 'r' && mode[0] != 'w' && mode[0] != 'a') {
 		PyErr_Format(PyExc_ValueError, "mode string must begin with "
 	        	    "one of 'r', 'w', 'a' or 'U', not '%.200s'", mode);
-		return 1;
+		return -1;
 	}
 
 	return 0;
@@ -204,7 +203,7 @@
 	}
 	strcpy(newmode, mode);
 
-	if (sanitize_the_mode(newmode)) {
+	if (_PyFile_SanitizeMode(newmode)) {
 		f = NULL;
 		goto cleanup;
 	}