Python - File detach() Method
The Python detach() method is used to separate the underlying raw stream from the buffer and return it. After the raw stream has been detached, the buffer is in an unusable state.
Some buffers, like BytesIO, do not have the concept of a single raw stream to return from this method. They raise UnsupportedOperation.
No parameter is required.
Returns the underlying raw stream separated from the buffer.
Throws UnsupportedOperation, if the buffer do not have the concept of a single raw stream to return from this method.❮ Python File Handling Methods