SF #1479181: split open() and file() from being aliases for each other.
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index 686db39..ff81faa 100644
--- a/Doc/lib/libfuncs.tex
+++ b/Doc/lib/libfuncs.tex
@@ -455,12 +455,7 @@
     after any I/O has been performed, and there's no reliable way to
     determine whether this is the case.}
 
-  The \function{file()} constructor is new in Python 2.2 and is an
-  alias for \function{open()}.  Both spellings are equivalent.  The
-  intent is for \function{open()} to continue to be preferred for use
-  as a factory function which returns a new \class{file} object.  The
-  spelling, \class{file} is more suited to type testing (for example,
-  writing \samp{isinstance(f, file)}).
+  \versionadded{2.2}
 \end{funcdesc}
 
 \begin{funcdesc}{filter}{function, list}
@@ -725,7 +720,10 @@
 \end{funcdesc}
 
 \begin{funcdesc}{open}{filename\optional{, mode\optional{, bufsize}}}
-  An alias for the \function{file()} function above.
+  A wrapper for the \function{file()} function above.  The intent is
+  for \function{open()} to be preferred for use as a factory function
+  returning a new \class{file} object.  \class{file} is more suited to
+  type testing (for example, writing \samp{isinstance(f, file)}).
 \end{funcdesc}
 
 \begin{funcdesc}{ord}{c}
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index c351ee9..88a4baa 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -347,7 +347,7 @@
                          stdout=subprocess.PIPE,
                          universal_newlines=1)
         stdout = p.stdout.read()
-        if hasattr(open, 'newlines'):
+        if hasattr(p.stdout, 'newlines'):
             # Interpreter with universal newline support
             self.assertEqual(stdout,
                              "line1\nline2\nline3\nline4\nline5\nline6")
@@ -374,7 +374,7 @@
                          stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                          universal_newlines=1)
         (stdout, stderr) = p.communicate()
-        if hasattr(open, 'newlines'):
+        if hasattr(stdout, 'newlines'):
             # Interpreter with universal newline support
             self.assertEqual(stdout,
                              "line1\nline2\nline3\nline4\nline5\nline6")
diff --git a/Misc/NEWS b/Misc/NEWS
index 1a180c2..8d88d9d 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@
 Core and builtins
 -----------------
 
+- Patch #1479181: split open() and file() from being aliases for each other.
+
 - Bug #1465834: 'bdist_wininst preinstall script support' was fixed
   by converting these apis from macros into exported functions again:
 
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index e08afe6..25b3361 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -2025,10 +2025,6 @@
 "'\\r', '\\n', '\\r\\n' or a tuple containing all the newline types seen.\n"
 "\n"
 "'U' cannot be combined with 'w' or '+' mode.\n"
-)
-PyDoc_STR(
-"\n"
-"Note:  open() is an alias for file()."
 );
 
 PyTypeObject PyFile_Type = {
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 27b4811..6fcc05e 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1342,6 +1342,18 @@
 
 
 static PyObject *
+builtin_open(PyObject *self, PyObject *args, PyObject *kwds)
+{
+	return PyObject_Call((PyObject*)&PyFile_Type, args, kwds);
+}
+
+PyDoc_STRVAR(open_doc,
+"open(name[, mode[, buffering]]) -> file object\n\
+\n\
+Open a file using the file() type, returns a file object.");
+
+
+static PyObject *
 builtin_ord(PyObject *self, PyObject* obj)
 {
 	long ord;
@@ -2247,6 +2259,7 @@
  	{"max",		(PyCFunction)builtin_max,        METH_VARARGS | METH_KEYWORDS, max_doc},
  	{"min",		(PyCFunction)builtin_min,        METH_VARARGS | METH_KEYWORDS, min_doc},
  	{"oct",		builtin_oct,        METH_O, oct_doc},
+ 	{"open",	(PyCFunction)builtin_open,       METH_VARARGS | METH_KEYWORDS, open_doc},
  	{"ord",		builtin_ord,        METH_O, ord_doc},
  	{"pow",		builtin_pow,        METH_VARARGS, pow_doc},
  	{"range",	builtin_range,      METH_VARARGS, range_doc},
@@ -2313,6 +2326,7 @@
 #endif
 	SETBUILTIN("dict",		&PyDict_Type);
  	SETBUILTIN("enumerate",		&PyEnum_Type);
+	SETBUILTIN("file",		&PyFile_Type);
 	SETBUILTIN("float",		&PyFloat_Type);
 	SETBUILTIN("frozenset",		&PyFrozenSet_Type);
 	SETBUILTIN("property",		&PyProperty_Type);
@@ -2329,10 +2343,6 @@
 	SETBUILTIN("tuple",		&PyTuple_Type);
 	SETBUILTIN("type",		&PyType_Type);
 	SETBUILTIN("xrange",		&PyRange_Type);
-
-	/* Note that open() is just an alias of file(). */
-	SETBUILTIN("open",		&PyFile_Type);
-	SETBUILTIN("file",		&PyFile_Type);
 #ifdef Py_USING_UNICODE
 	SETBUILTIN("unicode",		&PyUnicode_Type);
 #endif