summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-11-23 20:14:01 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-11-23 20:14:01 (GMT)
commit310e4c43cd87df44b170acf43f63cb94d00321c5 (patch)
treea0f7a9343a149ed2d0709f7f463e33903f6f56d5 /Modules
parente8b1ba1699d429b1e80ea7d31032628d09c3e43e (diff)
parentdd52c5a1c46b4d8e42e5e7a00f9b307f113de08d (diff)
downloadcpython-310e4c43cd87df44b170acf43f63cb94d00321c5.zip
cpython-310e4c43cd87df44b170acf43f63cb94d00321c5.tar.gz
cpython-310e4c43cd87df44b170acf43f63cb94d00321c5.tar.bz2
merge
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/_iomodule.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index eb701d4..9866fbe 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -126,8 +126,7 @@ PyDoc_STRVAR(open_doc,
"'b' binary mode\n"
"'t' text mode (default)\n"
"'+' open a disk file for updating (reading and writing)\n"
-"'U' universal newline mode (for backwards compatibility; unneeded\n"
-" for new code)\n"
+"'U' universal newline mode (deprecated)\n"
"========= ===============================================================\n"
"\n"
"The default mode is 'rt' (open for reading text). For binary random\n"
@@ -143,6 +142,10 @@ PyDoc_STRVAR(open_doc,
"returned as strings, the bytes having been first decoded using a\n"
"platform-dependent encoding or using the specified encoding if given.\n"
"\n"
+"'U' mode is deprecated and will raise an exception in future versions\n"
+"of Python. It has no effect in Python 3. Use newline to control\n"
+"universal newlines mode.\n"
+"\n"
"buffering is an optional integer used to set the buffering policy.\n"
"Pass 0 to switch buffering off (only allowed in binary mode), 1 to select\n"
"line buffering (only usable in text mode), and an integer > 1 to indicate\n"
@@ -310,6 +313,9 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds)
"can't use U and writing mode at once");
return NULL;
}
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "'U' mode is deprecated", 1) < 0)
+ return NULL;
reading = 1;
}