=== modified file 'Modules/posixmodule.c' --- Modules/posixmodule.c 2008-11-08 03:46:17 +0000 +++ Modules/posixmodule.c 2008-12-14 17:29:12 +0000 @@ -1998,6 +1998,13 @@ #ifdef Py_WIN_WIDE_FILENAMES DWORD len; +#endif + + if (PyErr_Warn(PyExc_DeprecationWarning, + "getcwdu will be removed from posix module in 3.x") < 0) + return NULL; + +#ifdef Py_WIN_WIDE_FILENAMES if (unicode_file_names()) { wchar_t wbuf[1026]; wchar_t *wbuf2 = wbuf; @@ -4125,6 +4132,11 @@ int err, bufsize = -1; FILE *fp; PyObject *f; + + if (PyErr_Warn(PyExc_DeprecationWarning, + "popen will be removed from posix module in 3.x") < 0) + return NULL; + if (!PyArg_ParseTuple(args, "s|si:popen", &name, &mode, &bufsize)) return NULL; Py_BEGIN_ALLOW_THREADS @@ -4150,6 +4162,11 @@ int bufsize = -1; FILE *fp; PyObject *f; + + if (PyErr_Warn(PyExc_DeprecationWarning, + "popen will be removed from posix module in 3.x") < 0) + return NULL; + if (!PyArg_ParseTuple(args, "s|si:popen", &name, &mode, &bufsize)) return NULL; Py_BEGIN_ALLOW_THREADS @@ -4762,6 +4779,11 @@ char *cmdstring; char *mode = "r"; int bufsize = -1; + + if (PyErr_Warn(PyExc_DeprecationWarning, + "popen will be removed from posix module in 3.x") < 0) + return NULL; + if (!PyArg_ParseTuple(args, "s|si:popen", &cmdstring, &mode, &bufsize)) return NULL; @@ -5471,6 +5493,11 @@ int bufsize = -1; FILE *fp; PyObject *f; + + if (PyErr_Warn(PyExc_DeprecationWarning, + "popen will be removed from posix module in 3.x") < 0) + return NULL; + if (!PyArg_ParseTuple(args, "s|si:popen", &name, &mode, &bufsize)) return NULL; /* Strip mode of binary or text modifiers */ @@ -6407,6 +6434,10 @@ FILE *fp; PyObject *f; char *mode; + if (PyErr_Warn(PyExc_DeprecationWarning, + "fdopen will be removed from posix module in 3.x") < 0) + return NULL; + if (!PyArg_ParseTuple(args, "i|si", &fd, &orgmode, &bufsize)) return NULL; @@ -7038,6 +7069,10 @@ "tempnam is a potential security risk to your program") < 0) return NULL; + if (PyErr_Warn(PyExc_DeprecationWarning, + "tempnam will be removed from posix module in 3.x") < 0) + return NULL; + #ifdef MS_WINDOWS name = _tempnam(dir, pfx); #else @@ -7062,6 +7097,10 @@ { FILE *fp; + if (PyErr_Warn(PyExc_DeprecationWarning, + "tmpfile will be removed from posix module in 3.x") < 0) + return NULL; + fp = tmpfile(); if (fp == NULL) return posix_error(); @@ -7085,6 +7124,10 @@ "tmpnam is a potential security risk to your program") < 0) return NULL; + if (PyErr_Warn(PyExc_DeprecationWarning, + "tmpnam will be removed from posix module in 3.x") < 0) + return NULL; + #ifdef USE_TMPNAM_R name = tmpnam_r(buffer); #else