Steven D'Aprano added the comment:
I think you may have misread the documentation. It says:
"an OS-level handle to an open file"
which is what you call a file descriptor. Not a file object, which is what you
get by calling the builtin `open`, but a file handle like you get from calling
`os.
New submission from Howard Waterfall :
The documentation for tempfile.mkstemp() says:
returns a tuple containing an OS-level handle to an open file (as would be
returned by os.open()) and the absolute pathname of that file, in that order.
I don't believe this is correct. It should say:
returns