MCPcopy Index your code
hub / github.com/RustPython/RustPython / fdopen

Function fdopen

Lib/os.py:1070–1076  ·  view source on GitHub ↗
(fd, mode="r", buffering=-1, encoding=None, *args, **kwargs)

Source from the content-addressed store, hash-verified

1068
1069# Supply os.fdopen()
1070def fdopen(fd, mode="r", buffering=-1, encoding=None, *args, **kwargs):
1071 if not isinstance(fd, int):
1072 raise TypeError("invalid fd type (%s, expected integer)" % type(fd))
1073 import io
1074 if "b" not in mode:
1075 encoding = io.text_encoding(encoding)
1076 return io.open(fd, mode, buffering, encoding, *args, **kwargs)
1077
1078
1079# For testing purposes, make sure the function is available when the C

Callers 1

fopenFunction · 0.85

Calls 2

isinstanceFunction · 0.85
openMethod · 0.45

Tested by

no test coverage detected