def readinto(self, b: bytearray) -> Optional[int]: raise io.UnsupportedOperation()
def detach(self): raise io.UnsupportedOperation("detach() not supported")
def _check_can_read(self): if not self.readable(): raise io.UnsupportedOperation("File not open for reading")
def readline(self, size=-1): """Read a line.""" raise io.UnsupportedOperation("cannot read a line from a Jupyter redirect")
def truncate(self, size=None): """Truncate both buffers.""" raise io.UnsupportedOperation("cannot truncate Jupyter redirect")
def seek(self, offset, whence=io.SEEK_SET): """Seek to a location.""" raise io.UnsupportedOperation("cannot seek Jupyter redirect")
def detach(self): """This operation is not supported.""" raise io.UnsupportedOperation("cannot detach a Jupyter redirect")
def _check_can_write(self): if self._mode != _MODE_WRITE: self._check_not_closed() raise io.UnsupportedOperation("File not open for writing")
def readinto(self, buf): raise io.UnsupportedOperation('readinto')
def read(self, n=-1): raise io.UnsupportedOperation("read")
def _check_can_read(self): if self._mode not in (_MODE_READ, _MODE_READ_EOF): self._check_not_closed() raise io.UnsupportedOperation("File not open for reading")
def write(self, b): # This is needed because python will not always return the correct # kind of error even though writeable returns False. raise io.UnsupportedOperation("write")
def write(self, b: bytes) -> int: raise io.UnsupportedOperation()
def __next__(self): """Iterator API.""" raise io.UnsupportedOperation('Cannot iterate an EncryptingStream')
def read(self, size=-1): raise io.UnsupportedOperation('read')
def seek(self, pos: int, whence: int = 0) -> int: if self._seekable: return self._bytes_io.seek(pos, whence) raise io.UnsupportedOperation('seek')
def write(self, value): raise io.UnsupportedOperation('write')
def seek(self, pos: int, whence: int = 0) -> int: if self._seekable: return super(SlowBytesIO, self).seek(pos, whence) raise io.UnsupportedOperation('seek')
def truncate(self, size=None): """Truncate the streams.""" raise io.UnsupportedOperation("cannot truncate Jupyter redirect")
def write(self, _): """See io.RawIOBase.write.""" raise io.UnsupportedOperation('write')
def read(self, size=None): """Read from the stream""" raise io.UnsupportedOperation("cannot read a Jupyter redirect")
def readinto1(self, *args, **kwargs): if 'r' not in self.mode and '+' not in self.mode: raise io.UnsupportedOperation('not readable') return self.stream.readinto1(*args, **kwargs)
def seek(self, offset, whence=io.SEEK_SET): """Sets the location in both the stdbuf and the membuf.""" raise io.UnsupportedOperation("cannot seek Jupyter redirect")
def read(self, size=-1): if 'r' not in self.mode and '+' not in self.mode: raise io.UnsupportedOperation('not readable') return self.stream.read(size)
def readinto(self, b): """Read bytes into buffer from both streams.""" raise io.UnsupportedOperation("cannot read into Jupyter redirect")
def readlines(self, hint=-1): if 'r' not in self.mode and '+' not in self.mode: raise io.UnsupportedOperation('not readable') return self.stream.readlines(hint)
def fileno_opt(self): raise io.UnsupportedOperation('Not a real file')
def write(self, s): if 'r' in self.mode and '+' not in self.mode: raise io.UnsupportedOperation('not writable') return self.stream.write(s)
def _check_can_write(self): if not self.writable(): raise io.UnsupportedOperation("File not open for writing")
def fileno(self) -> int: raise io.UnsupportedOperation( "redirected stdin is pseudofile, has no fileno()")