mirror of
https://github.com/python/cpython.git
synced 2025-09-09 02:11:51 +00:00
Warn abou missing mutate flag to ioctl. Fixes #696535.
This commit is contained in:
parent
6b08a40442
commit
77ca6c4c84
3 changed files with 11 additions and 1 deletions
|
@ -669,6 +669,8 @@ changes to your code:
|
||||||
system ID in the wrong order. This has been corrected; applications
|
system ID in the wrong order. This has been corrected; applications
|
||||||
relying on the wrong order need to be fixed.
|
relying on the wrong order need to be fixed.
|
||||||
|
|
||||||
|
\item \function{fcntl.ioctl} now warns if the mutate arg is omitted.
|
||||||
|
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -214,6 +214,8 @@ Core and builtins
|
||||||
Extension modules
|
Extension modules
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- fcntl.ioctl now warns if the mutate flag is not specified.
|
||||||
|
|
||||||
- nt now properly allows to refer to UNC roots, e.g. in nt.stat().
|
- nt now properly allows to refer to UNC roots, e.g. in nt.stat().
|
||||||
|
|
||||||
- the weakref module now supports additional objects: array.array,
|
- the weakref module now supports additional objects: array.array,
|
||||||
|
|
|
@ -108,7 +108,13 @@ fcntl_ioctl(PyObject *self, PyObject *args)
|
||||||
char *arg;
|
char *arg;
|
||||||
|
|
||||||
if (PyTuple_Size(args) == 3) {
|
if (PyTuple_Size(args) == 3) {
|
||||||
/* warning goes here in 2.4 */
|
#if (PY_MAJOR_VERSION>2) || (PY_MINOR_VERSION>=5)
|
||||||
|
#error Remove the warning, change mutate_arg to 1
|
||||||
|
#endif
|
||||||
|
if (PyErr_Warn(PyExc_FutureWarning,
|
||||||
|
"ioctl with mutable buffer will mutate the buffer by default in 2.5"
|
||||||
|
) < 0)
|
||||||
|
return NULL;
|
||||||
mutate_arg = 0;
|
mutate_arg = 0;
|
||||||
}
|
}
|
||||||
if (mutate_arg) {
|
if (mutate_arg) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue