This is barry-scott's patch:
[ 1231069 ] ioctl has problem with -ive request codes
by using the 'I' not the 'i' format code to PyArg_ParseTuple().
Backport candidate? Maybe...
diff --git a/Misc/NEWS b/Misc/NEWS
index f168fa1..1bbec39 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -117,6 +117,10 @@
Extension Modules
-----------------
+- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
+ the request code argument, which results in more C-like behaviour
+ for large or negative values.
+
- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
implemented treated all integer values except 1 as false.