#2491: os.fdopen() is now almost an alias to the builtin open(), and accepts the same parameters.
It just checks that the first argument is a file descriptor.
diff --git a/Lib/os.py b/Lib/os.py
index a04aa7f..2fdf668 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -651,9 +651,9 @@
def __iter__(self):
return iter(self._stream)
-# Supply os.fdopen() (used by subprocess!)
-def fdopen(fd, mode="r", buffering=-1):
+# Supply os.fdopen()
+def fdopen(fd, *args, **kwargs):
if not isinstance(fd, int):
raise TypeError("invalid fd type (%s, expected integer)" % type(fd))
import io
- return io.open(fd, mode, buffering)
+ return io.open(fd, *args, **kwargs)