Merging appropriate 2.1.1 fixes back into the main trunk.
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c
index 10c5a5f..b82395c 100644
--- a/Mac/Python/macmain.c
+++ b/Mac/Python/macmain.c
@@ -486,6 +486,11 @@
 			PyMac_FixGUSIcd();
 #endif
 		}
+		/* Check that the first argument is a text file */
+		if ( PyMac_getfiletype(argv[1]) != 'TEXT' ) {
+			Alert(NOTASCRIPT_ID, NULL);
+			exit(0);
+		}
 	}
 	Py_Main(argc, argv);
 }