Mass checkin of universal newline support.
Highlights: import and friends will understand any of \r, \n and \r\n
as end of line. Python file input will do the same if you use mode 'U'.
Everything can be disabled by configuring with --without-universal-newlines.
See PEP278 for details.
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c
index 8b38a2c..a4f7dc4 100644
--- a/Mac/Python/macmain.c
+++ b/Mac/Python/macmain.c
@@ -611,7 +611,7 @@
Py_GetVersion(), Py_GetPlatform(), COPYRIGHT);
if (filename != NULL) {
- if ((fp = fopen(filename, "r")) == NULL) {
+ if ((fp = fopen(filename, "r" PY_STDIOTEXTMODE)) == NULL) {
fprintf(stderr, "%s: can't open file '%s'\n",
argv[0], filename);
PyMac_Exit(2);
@@ -630,7 +630,7 @@
PySys_SetArgv(argc, argv);
if (filename == NULL && isatty((int)fileno(fp))) {
- FILE *fp = fopen(STARTUP, "r");
+ FILE *fp = fopen(STARTUP, "r" PY_STDIOTEXTMODE);
if (fp != NULL) {
(void) PyRun_SimpleFile(fp, STARTUP);
PyErr_Clear();